diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/alloc.c b/src/alloc.c index 3939e704978..7d1ff7625f2 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -155,7 +155,7 @@ static pthread_mutex_t alloc_mutex; | |||
| 155 | 155 | ||
| 156 | /* Default value of gc_cons_threshold (see below). */ | 156 | /* Default value of gc_cons_threshold (see below). */ |
| 157 | 157 | ||
| 158 | #define GC_DEFAULT_THRESHOLD (100000 * sizeof (Lisp_Object)) | 158 | #define GC_DEFAULT_THRESHOLD (100000 * word_size) |
| 159 | 159 | ||
| 160 | /* Global variables. */ | 160 | /* Global variables. */ |
| 161 | struct emacs_globals globals; | 161 | struct emacs_globals globals; |
| @@ -278,14 +278,6 @@ static void sweep_strings (void); | |||
| 278 | static void free_misc (Lisp_Object); | 278 | static void free_misc (Lisp_Object); |
| 279 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; | 279 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; |
| 280 | 280 | ||
| 281 | /* Handy constants for vectorlike objects. */ | ||
| 282 | enum | ||
| 283 | { | ||
| 284 | header_size = offsetof (struct Lisp_Vector, contents), | ||
| 285 | bool_header_size = offsetof (struct Lisp_Bool_Vector, data), | ||
| 286 | word_size = sizeof (Lisp_Object) | ||
| 287 | }; | ||
| 288 | |||
| 289 | /* When scanning the C stack for live Lisp objects, Emacs keeps track | 281 | /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 290 | of what memory allocated via lisp_malloc is intended for what | 282 | of what memory allocated via lisp_malloc is intended for what |
| 291 | purpose. This enumeration specifies the type of memory. */ | 283 | purpose. This enumeration specifies the type of memory. */ |
| @@ -2810,9 +2802,9 @@ listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) | |||
| 2810 | Lisp_Object val, *objp; | 2802 | Lisp_Object val, *objp; |
| 2811 | 2803 | ||
| 2812 | /* Change to SAFE_ALLOCA if you hit this eassert. */ | 2804 | /* Change to SAFE_ALLOCA if you hit this eassert. */ |
| 2813 | eassert (count <= MAX_ALLOCA / sizeof (Lisp_Object)); | 2805 | eassert (count <= MAX_ALLOCA / word_size); |
| 2814 | 2806 | ||
| 2815 | objp = alloca (count * sizeof (Lisp_Object)); | 2807 | objp = alloca (count * word_size); |
| 2816 | objp[0] = arg; | 2808 | objp[0] = arg; |
| 2817 | va_start (ap, arg); | 2809 | va_start (ap, arg); |
| 2818 | for (i = 1; i < count; i++) | 2810 | for (i = 1; i < count; i++) |