diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-09-06 21:25:12 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-09-06 21:25:12 +0000 |
commit | 93c27ef1aa381d52cb84866451bc07c6095e1bd4 (patch) | |
tree | f89040cf6c39505386bf11c478153c2d555d472b /src/buffer.c | |
parent | 09e9dd66e1acab8b399ae62400c13eeee310e888 (diff) | |
download | emacs-93c27ef1aa381d52cb84866451bc07c6095e1bd4.tar.gz |
(init_buffer) [REL_ALLOC_MMAP]: Map new buffer
text buffers if necessary.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 3a830476d03..5c5c2e05b25 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4217,12 +4217,29 @@ init_buffer_once () void init_buffer () { - char buf[MAXPATHLEN+1]; + char buf[MAXPATHLEN + 1]; char *pwd; struct stat dotstat, pwdstat; Lisp_Object temp; int rc; +#ifdef REL_ALLOC_MMAP + { + /* When using the ralloc implementation based on mmap(2), buffer + text pointers will have been set to null in the dumped Emacs. + Map new memory. */ + struct buffer *b; + + BLOCK_INPUT; + for (b = all_buffers; b; b = b->next) + if (b->text->beg == NULL) + BUFFER_REALLOC (BUF_BEG_ADDR (b), + (BUF_Z_BYTE (b) - BUF_BEG_BYTE (b) + + BUF_GAP_SIZE (b) + 1)); + UNBLOCK_INPUT; + } +#endif /* REL_ALLOC_MMAP */ + Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); if (NILP (buffer_defaults.enable_multibyte_characters)) Fset_buffer_multibyte (Qnil); |