Mercurial > emacs
comparison src/alloc.c @ 31576:717e7e2ca4fd
Add some comments about DOUG_LEA_MALLOC's use of mmap
and allocation of Lisp data.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Wed, 13 Sep 2000 09:18:49 +0000 |
| parents | 6a0caa788013 |
| children | 43566b0aec59 |
comparison
equal
deleted
inserted
replaced
| 31575:722700be186b | 31576:717e7e2ca4fd |
|---|---|
| 1047 if (nbytes > LARGE_STRING_BYTES) | 1047 if (nbytes > LARGE_STRING_BYTES) |
| 1048 { | 1048 { |
| 1049 size_t size = sizeof *b - sizeof (struct sdata) + needed; | 1049 size_t size = sizeof *b - sizeof (struct sdata) + needed; |
| 1050 | 1050 |
| 1051 #ifdef DOUG_LEA_MALLOC | 1051 #ifdef DOUG_LEA_MALLOC |
| 1052 /* Prevent mmap'ing the chunk (which is potentially very large). */ | 1052 /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed |
| 1053 because mapped region contents are not preserved in | |
| 1054 a dumped Emacs. */ | |
| 1053 mallopt (M_MMAP_MAX, 0); | 1055 mallopt (M_MMAP_MAX, 0); |
| 1054 #endif | 1056 #endif |
| 1055 | 1057 |
| 1056 b = (struct sblock *) lisp_malloc (size, MEM_TYPE_NON_LISP); | 1058 b = (struct sblock *) lisp_malloc (size, MEM_TYPE_NON_LISP); |
| 1057 | 1059 |
| 1836 { | 1838 { |
| 1837 struct Lisp_Vector *p; | 1839 struct Lisp_Vector *p; |
| 1838 size_t nbytes; | 1840 size_t nbytes; |
| 1839 | 1841 |
| 1840 #ifdef DOUG_LEA_MALLOC | 1842 #ifdef DOUG_LEA_MALLOC |
| 1841 /* Prevent mmap'ing the chunk (which is potentially very large).. */ | 1843 /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed |
| 1844 because mapped region contents are not preserved in | |
| 1845 a dumped Emacs. */ | |
| 1842 mallopt (M_MMAP_MAX, 0); | 1846 mallopt (M_MMAP_MAX, 0); |
| 1843 #endif | 1847 #endif |
| 1844 | 1848 |
| 1845 nbytes = sizeof *p + (len - 1) * sizeof p->contents[0]; | 1849 nbytes = sizeof *p + (len - 1) * sizeof p->contents[0]; |
| 1846 p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTOR); | 1850 p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTOR); |
