aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-01-02 00:10:26 +0000
committerRichard M. Stallman1999-01-02 00:10:26 +0000
commit81d492d5da8d8d24f30ed514c4de9e968bcc2b6b (patch)
treeabac58aea9f49096913862c209274a07543ead46 /src
parent598a61e6fd2f8af9217538a851d9c0721e768650 (diff)
downloademacs-81d492d5da8d8d24f30ed514c4de9e968bcc2b6b.tar.gz
emacs-81d492d5da8d8d24f30ed514c4de9e968bcc2b6b.zip
(MMAP_MAX_AREAS): New macro.
(allocate_vectorlike, make_uninit_multibyte_string): Use that. (init_alloc_once): Use that.
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 8671a702779..79e3278680b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -42,6 +42,12 @@ extern char *sbrk ();
42#ifdef DOUG_LEA_MALLOC 42#ifdef DOUG_LEA_MALLOC
43#include <malloc.h> 43#include <malloc.h>
44#define __malloc_size_t int 44#define __malloc_size_t int
45
46/* Specify maximum number of areas to mmap.
47 It would be nice to use a value that explicitly
48 means "no limit". */
49#define MMAP_MAX_AREAS 100000000
50
45#else 51#else
46/* The following come from gmalloc.c. */ 52/* The following come from gmalloc.c. */
47 53
@@ -840,7 +846,7 @@ allocate_vectorlike (len)
840 + (len - 1) * sizeof (Lisp_Object)); 846 + (len - 1) * sizeof (Lisp_Object));
841#ifdef DOUG_LEA_MALLOC 847#ifdef DOUG_LEA_MALLOC
842 /* Back to a reasonable maximum of mmap'ed areas. */ 848 /* Back to a reasonable maximum of mmap'ed areas. */
843 mallopt (M_MMAP_MAX, 64); 849 mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
844#endif 850#endif
845 VALIDATE_LISP_STORAGE (p, 0); 851 VALIDATE_LISP_STORAGE (p, 0);
846 consing_since_gc += (sizeof (struct Lisp_Vector) 852 consing_since_gc += (sizeof (struct Lisp_Vector)
@@ -1427,7 +1433,7 @@ make_uninit_multibyte_string (length, length_byte)
1427 new = (struct string_block *) lisp_malloc (sizeof (struct string_block_head) + fullsize); 1433 new = (struct string_block *) lisp_malloc (sizeof (struct string_block_head) + fullsize);
1428#ifdef DOUG_LEA_MALLOC 1434#ifdef DOUG_LEA_MALLOC
1429 /* Back to a reasonable maximum of mmap'ed areas. */ 1435 /* Back to a reasonable maximum of mmap'ed areas. */
1430 mallopt (M_MMAP_MAX, 64); 1436 mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
1431#endif 1437#endif
1432 n_string_blocks++; 1438 n_string_blocks++;
1433 VALIDATE_LISP_STORAGE (new, 0); 1439 VALIDATE_LISP_STORAGE (new, 0);
@@ -3014,7 +3020,7 @@ init_alloc_once ()
3014#ifdef DOUG_LEA_MALLOC 3020#ifdef DOUG_LEA_MALLOC
3015 mallopt (M_TRIM_THRESHOLD, 128*1024); /* trim threshold */ 3021 mallopt (M_TRIM_THRESHOLD, 128*1024); /* trim threshold */
3016 mallopt (M_MMAP_THRESHOLD, 64*1024); /* mmap threshold */ 3022 mallopt (M_MMAP_THRESHOLD, 64*1024); /* mmap threshold */
3017 mallopt (M_MMAP_MAX, 64); /* max. number of mmap'ed areas */ 3023 mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); /* max. number of mmap'ed areas */
3018#endif 3024#endif
3019 init_strings (); 3025 init_strings ();
3020 init_cons (); 3026 init_cons ();