Mercurial > emacs
comparison src/buffer.c @ 31412:828b2b8afdc0
(init_buffer) [REL_ALLOC_MMAP]: Map new buffer
text buffers if necessary.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Wed, 06 Sep 2000 21:25:12 +0000 |
| parents | d0f522cf422b |
| children | 9b8c5bea5e8d |
comparison
equal
deleted
inserted
replaced
| 31411:920b03e019bf | 31412:828b2b8afdc0 |
|---|---|
| 4215 } | 4215 } |
| 4216 | 4216 |
| 4217 void | 4217 void |
| 4218 init_buffer () | 4218 init_buffer () |
| 4219 { | 4219 { |
| 4220 char buf[MAXPATHLEN+1]; | 4220 char buf[MAXPATHLEN + 1]; |
| 4221 char *pwd; | 4221 char *pwd; |
| 4222 struct stat dotstat, pwdstat; | 4222 struct stat dotstat, pwdstat; |
| 4223 Lisp_Object temp; | 4223 Lisp_Object temp; |
| 4224 int rc; | 4224 int rc; |
| 4225 | 4225 |
| 4226 #ifdef REL_ALLOC_MMAP | |
| 4227 { | |
| 4228 /* When using the ralloc implementation based on mmap(2), buffer | |
| 4229 text pointers will have been set to null in the dumped Emacs. | |
| 4230 Map new memory. */ | |
| 4231 struct buffer *b; | |
| 4232 | |
| 4233 BLOCK_INPUT; | |
| 4234 for (b = all_buffers; b; b = b->next) | |
| 4235 if (b->text->beg == NULL) | |
| 4236 BUFFER_REALLOC (BUF_BEG_ADDR (b), | |
| 4237 (BUF_Z_BYTE (b) - BUF_BEG_BYTE (b) | |
| 4238 + BUF_GAP_SIZE (b) + 1)); | |
| 4239 UNBLOCK_INPUT; | |
| 4240 } | |
| 4241 #endif /* REL_ALLOC_MMAP */ | |
| 4242 | |
| 4226 Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); | 4243 Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); |
| 4227 if (NILP (buffer_defaults.enable_multibyte_characters)) | 4244 if (NILP (buffer_defaults.enable_multibyte_characters)) |
| 4228 Fset_buffer_multibyte (Qnil); | 4245 Fset_buffer_multibyte (Qnil); |
| 4229 | 4246 |
| 4230 /* If PWD is accurate, use it instead of calling getwd. This is faster | 4247 /* If PWD is accurate, use it instead of calling getwd. This is faster |
