diff options
| author | Joakim Verona | 2011-02-05 11:23:09 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-02-05 11:23:09 +0100 |
| commit | 4bd51ad5c3445b644dfb017d5b57b10a90aa325f (patch) | |
| tree | 894801e7308ce4ecc34933f959e28f4b9cff9533 /src/alloc.c | |
| parent | 13cfe8df462ab8da9f0028e16cc84dcaceaca3d1 (diff) | |
| parent | 9bcaafce5351d270ac514e23cb69ff1a5fd35229 (diff) | |
| download | emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.tar.gz emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.zip | |
merge from upstream. currently seems to have bitroted and i get segfaults
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 142 |
1 files changed, 59 insertions, 83 deletions
diff --git a/src/alloc.c b/src/alloc.c index fa39c1ee5dc..67d34d25642 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | /* Storage allocation and gc for GNU Emacs Lisp interpreter. | 1 | /* Storage allocation and gc for GNU Emacs Lisp interpreter. |
| 2 | Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, | 2 | Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2011 |
| 3 | 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | ||
| 4 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 5 | 4 | ||
| 6 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -59,9 +58,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 59 | #undef GC_MALLOC_CHECK | 58 | #undef GC_MALLOC_CHECK |
| 60 | #endif | 59 | #endif |
| 61 | 60 | ||
| 62 | #ifdef HAVE_UNISTD_H | ||
| 63 | #include <unistd.h> | 61 | #include <unistd.h> |
| 64 | #else | 62 | #ifndef HAVE_UNISTD_H |
| 65 | extern POINTER_TYPE *sbrk (); | 63 | extern POINTER_TYPE *sbrk (); |
| 66 | #endif | 64 | #endif |
| 67 | 65 | ||
| @@ -143,8 +141,6 @@ static pthread_mutex_t alloc_mutex; | |||
| 143 | 141 | ||
| 144 | static __malloc_size_t bytes_used_when_full; | 142 | static __malloc_size_t bytes_used_when_full; |
| 145 | 143 | ||
| 146 | static __malloc_size_t bytes_used_when_reconsidered; | ||
| 147 | |||
| 148 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer | 144 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer |
| 149 | to a struct Lisp_String. */ | 145 | to a struct Lisp_String. */ |
| 150 | 146 | ||
| @@ -164,31 +160,17 @@ static __malloc_size_t bytes_used_when_reconsidered; | |||
| 164 | #define GC_STRING_BYTES(S) (STRING_BYTES (S)) | 160 | #define GC_STRING_BYTES(S) (STRING_BYTES (S)) |
| 165 | #define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG) | 161 | #define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG) |
| 166 | 162 | ||
| 163 | /* Global variables. */ | ||
| 164 | struct emacs_globals globals; | ||
| 165 | |||
| 167 | /* Number of bytes of consing done since the last gc. */ | 166 | /* Number of bytes of consing done since the last gc. */ |
| 168 | 167 | ||
| 169 | int consing_since_gc; | 168 | int consing_since_gc; |
| 170 | 169 | ||
| 171 | /* Count the amount of consing of various sorts of space. */ | ||
| 172 | |||
| 173 | EMACS_INT cons_cells_consed; | ||
| 174 | EMACS_INT floats_consed; | ||
| 175 | EMACS_INT vector_cells_consed; | ||
| 176 | EMACS_INT symbols_consed; | ||
| 177 | EMACS_INT string_chars_consed; | ||
| 178 | EMACS_INT misc_objects_consed; | ||
| 179 | EMACS_INT intervals_consed; | ||
| 180 | EMACS_INT strings_consed; | ||
| 181 | |||
| 182 | /* Minimum number of bytes of consing since GC before next GC. */ | ||
| 183 | |||
| 184 | EMACS_INT gc_cons_threshold; | ||
| 185 | |||
| 186 | /* Similar minimum, computed from Vgc_cons_percentage. */ | 170 | /* Similar minimum, computed from Vgc_cons_percentage. */ |
| 187 | 171 | ||
| 188 | EMACS_INT gc_relative_threshold; | 172 | EMACS_INT gc_relative_threshold; |
| 189 | 173 | ||
| 190 | static Lisp_Object Vgc_cons_percentage; | ||
| 191 | |||
| 192 | /* Minimum number of bytes of consing since GC before next GC, | 174 | /* Minimum number of bytes of consing since GC before next GC, |
| 193 | when memory is full. */ | 175 | when memory is full. */ |
| 194 | 176 | ||
| @@ -204,10 +186,6 @@ int gc_in_progress; | |||
| 204 | 186 | ||
| 205 | int abort_on_gc; | 187 | int abort_on_gc; |
| 206 | 188 | ||
| 207 | /* Nonzero means display messages at beginning and end of GC. */ | ||
| 208 | |||
| 209 | int garbage_collection_messages; | ||
| 210 | |||
| 211 | /* Number of live and free conses etc. */ | 189 | /* Number of live and free conses etc. */ |
| 212 | 190 | ||
| 213 | static int total_conses, total_markers, total_symbols, total_vector_size; | 191 | static int total_conses, total_markers, total_symbols, total_vector_size; |
| @@ -228,14 +206,6 @@ static char *spare_memory[7]; | |||
| 228 | 206 | ||
| 229 | static int malloc_hysteresis; | 207 | static int malloc_hysteresis; |
| 230 | 208 | ||
| 231 | /* Non-nil means defun should do purecopy on the function definition. */ | ||
| 232 | |||
| 233 | Lisp_Object Vpurify_flag; | ||
| 234 | |||
| 235 | /* Non-nil means we are handling a memory-full error. */ | ||
| 236 | |||
| 237 | Lisp_Object Vmemory_full; | ||
| 238 | |||
| 239 | /* Initialize it to a nonzero value to force it into data space | 209 | /* Initialize it to a nonzero value to force it into data space |
| 240 | (rather than bss space). That way unexec will remap it into text | 210 | (rather than bss space). That way unexec will remap it into text |
| 241 | space (pure), on some systems. We have not implemented the | 211 | space (pure), on some systems. We have not implemented the |
| @@ -263,10 +233,6 @@ static size_t pure_bytes_used_before_overflow; | |||
| 263 | && ((PNTR_COMPARISON_TYPE) (P) \ | 233 | && ((PNTR_COMPARISON_TYPE) (P) \ |
| 264 | >= (PNTR_COMPARISON_TYPE) purebeg)) | 234 | >= (PNTR_COMPARISON_TYPE) purebeg)) |
| 265 | 235 | ||
| 266 | /* Total number of bytes allocated in pure storage. */ | ||
| 267 | |||
| 268 | EMACS_INT pure_bytes_used; | ||
| 269 | |||
| 270 | /* Index in pure at which next pure Lisp object will be allocated.. */ | 236 | /* Index in pure at which next pure Lisp object will be allocated.. */ |
| 271 | 237 | ||
| 272 | static EMACS_INT pure_bytes_used_lisp; | 238 | static EMACS_INT pure_bytes_used_lisp; |
| @@ -280,10 +246,6 @@ static EMACS_INT pure_bytes_used_non_lisp; | |||
| 280 | 246 | ||
| 281 | const char *pending_malloc_warning; | 247 | const char *pending_malloc_warning; |
| 282 | 248 | ||
| 283 | /* Pre-computed signal argument for use when memory is exhausted. */ | ||
| 284 | |||
| 285 | Lisp_Object Vmemory_signal_data; | ||
| 286 | |||
| 287 | /* Maximum amount of C stack to save when a GC happens. */ | 249 | /* Maximum amount of C stack to save when a GC happens. */ |
| 288 | 250 | ||
| 289 | #ifndef MAX_SAVE_STACK | 251 | #ifndef MAX_SAVE_STACK |
| @@ -304,10 +266,7 @@ Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; | |||
| 304 | 266 | ||
| 305 | /* Hook run after GC has finished. */ | 267 | /* Hook run after GC has finished. */ |
| 306 | 268 | ||
| 307 | Lisp_Object Vpost_gc_hook, Qpost_gc_hook; | 269 | Lisp_Object Qpost_gc_hook; |
| 308 | |||
| 309 | Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ | ||
| 310 | EMACS_INT gcs_done; /* accumulated GCs */ | ||
| 311 | 270 | ||
| 312 | static void mark_buffer (Lisp_Object); | 271 | static void mark_buffer (Lisp_Object); |
| 313 | static void mark_terminals (void); | 272 | static void mark_terminals (void); |
| @@ -351,7 +310,6 @@ enum mem_type | |||
| 351 | 310 | ||
| 352 | static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type); | 311 | static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type); |
| 353 | static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); | 312 | static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); |
| 354 | void refill_memory_reserve (void); | ||
| 355 | 313 | ||
| 356 | 314 | ||
| 357 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK | 315 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK |
| @@ -1141,6 +1099,8 @@ static void * (*old_malloc_hook) (size_t, const void *); | |||
| 1141 | static void * (*old_realloc_hook) (void *, size_t, const void*); | 1099 | static void * (*old_realloc_hook) (void *, size_t, const void*); |
| 1142 | static void (*old_free_hook) (void*, const void*); | 1100 | static void (*old_free_hook) (void*, const void*); |
| 1143 | 1101 | ||
| 1102 | static __malloc_size_t bytes_used_when_reconsidered; | ||
| 1103 | |||
| 1144 | /* This function is used as the hook for free to call. */ | 1104 | /* This function is used as the hook for free to call. */ |
| 1145 | 1105 | ||
| 1146 | static void | 1106 | static void |
| @@ -1492,8 +1452,7 @@ mark_interval_tree (register INTERVAL tree) | |||
| 1492 | can't create number objects in macros. */ | 1452 | can't create number objects in macros. */ |
| 1493 | #ifndef make_number | 1453 | #ifndef make_number |
| 1494 | Lisp_Object | 1454 | Lisp_Object |
| 1495 | make_number (n) | 1455 | make_number (EMACS_INT n) |
| 1496 | EMACS_INT n; | ||
| 1497 | { | 1456 | { |
| 1498 | Lisp_Object obj; | 1457 | Lisp_Object obj; |
| 1499 | obj.s.val = n; | 1458 | obj.s.val = n; |
| @@ -3987,8 +3946,14 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", | |||
| 3987 | static INLINE void | 3946 | static INLINE void |
| 3988 | mark_maybe_object (Lisp_Object obj) | 3947 | mark_maybe_object (Lisp_Object obj) |
| 3989 | { | 3948 | { |
| 3990 | void *po = (void *) XPNTR (obj); | 3949 | void *po; |
| 3991 | struct mem_node *m = mem_find (po); | 3950 | struct mem_node *m; |
| 3951 | |||
| 3952 | if (INTEGERP (obj)) | ||
| 3953 | return; | ||
| 3954 | |||
| 3955 | po = (void *) XPNTR (obj); | ||
| 3956 | m = mem_find (po); | ||
| 3992 | 3957 | ||
| 3993 | if (m != MEM_NIL) | 3958 | if (m != MEM_NIL) |
| 3994 | { | 3959 | { |
| @@ -4218,7 +4183,7 @@ Please mail the result to <emacs-devel@gnu.org>.\n\ | |||
| 4218 | can prove that. */ | 4183 | can prove that. */ |
| 4219 | 4184 | ||
| 4220 | static void | 4185 | static void |
| 4221 | test_setjmp () | 4186 | test_setjmp (void) |
| 4222 | { | 4187 | { |
| 4223 | char buf[10]; | 4188 | char buf[10]; |
| 4224 | register int x; | 4189 | register int x; |
| @@ -4266,7 +4231,7 @@ test_setjmp () | |||
| 4266 | /* Abort if anything GCPRO'd doesn't survive the GC. */ | 4231 | /* Abort if anything GCPRO'd doesn't survive the GC. */ |
| 4267 | 4232 | ||
| 4268 | static void | 4233 | static void |
| 4269 | check_gcpros () | 4234 | check_gcpros (void) |
| 4270 | { | 4235 | { |
| 4271 | struct gcpro *p; | 4236 | struct gcpro *p; |
| 4272 | int i; | 4237 | int i; |
| @@ -4282,7 +4247,7 @@ check_gcpros () | |||
| 4282 | #elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | 4247 | #elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
| 4283 | 4248 | ||
| 4284 | static void | 4249 | static void |
| 4285 | dump_zombies () | 4250 | dump_zombies (void) |
| 4286 | { | 4251 | { |
| 4287 | int i; | 4252 | int i; |
| 4288 | 4253 | ||
| @@ -4317,6 +4282,11 @@ dump_zombies () | |||
| 4317 | have to be true! It must be verified for each system, possibly | 4282 | have to be true! It must be verified for each system, possibly |
| 4318 | by taking a look at the source code of setjmp. | 4283 | by taking a look at the source code of setjmp. |
| 4319 | 4284 | ||
| 4285 | If __builtin_unwind_init is available (defined by GCC >= 2.8) we | ||
| 4286 | can use it as a machine independent method to store all registers | ||
| 4287 | to the stack. In this case the macros described in the previous | ||
| 4288 | two paragraphs are not used. | ||
| 4289 | |||
| 4320 | Stack Layout | 4290 | Stack Layout |
| 4321 | 4291 | ||
| 4322 | Architectures differ in the way their processor stack is organized. | 4292 | Architectures differ in the way their processor stack is organized. |
| @@ -4355,6 +4325,13 @@ mark_stack (void) | |||
| 4355 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; | 4325 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; |
| 4356 | void *end; | 4326 | void *end; |
| 4357 | 4327 | ||
| 4328 | #ifdef HAVE___BUILTIN_UNWIND_INIT | ||
| 4329 | /* Force callee-saved registers and register windows onto the stack. | ||
| 4330 | This is the preferred method if available, obviating the need for | ||
| 4331 | machine dependent methods. */ | ||
| 4332 | __builtin_unwind_init (); | ||
| 4333 | end = &end; | ||
| 4334 | #else /* not HAVE___BUILTIN_UNWIND_INIT */ | ||
| 4358 | /* This trick flushes the register windows so that all the state of | 4335 | /* This trick flushes the register windows so that all the state of |
| 4359 | the process is contained in the stack. */ | 4336 | the process is contained in the stack. */ |
| 4360 | /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is | 4337 | /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is |
| @@ -4390,6 +4367,7 @@ mark_stack (void) | |||
| 4390 | setjmp (j.j); | 4367 | setjmp (j.j); |
| 4391 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; | 4368 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; |
| 4392 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ | 4369 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ |
| 4370 | #endif /* not HAVE___BUILTIN_UNWIND_INIT */ | ||
| 4393 | 4371 | ||
| 4394 | /* This assumes that the stack is a contiguous region in memory. If | 4372 | /* This assumes that the stack is a contiguous region in memory. If |
| 4395 | that's not the case, something has to be done here to iterate | 4373 | that's not the case, something has to be done here to iterate |
| @@ -4778,7 +4756,7 @@ Does not copy symbols. Copies strings without text properties. */) | |||
| 4778 | else if (FLOATP (obj)) | 4756 | else if (FLOATP (obj)) |
| 4779 | obj = make_pure_float (XFLOAT_DATA (obj)); | 4757 | obj = make_pure_float (XFLOAT_DATA (obj)); |
| 4780 | else if (STRINGP (obj)) | 4758 | else if (STRINGP (obj)) |
| 4781 | obj = make_pure_string (SDATA (obj), SCHARS (obj), | 4759 | obj = make_pure_string (SSDATA (obj), SCHARS (obj), |
| 4782 | SBYTES (obj), | 4760 | SBYTES (obj), |
| 4783 | STRING_MULTIBYTE (obj)); | 4761 | STRING_MULTIBYTE (obj)); |
| 4784 | else if (COMPILEDP (obj) || VECTORP (obj)) | 4762 | else if (COMPILEDP (obj) || VECTORP (obj)) |
| @@ -5265,7 +5243,7 @@ mark_char_table (struct Lisp_Vector *ptr) | |||
| 5265 | { | 5243 | { |
| 5266 | Lisp_Object val = ptr->contents[i]; | 5244 | Lisp_Object val = ptr->contents[i]; |
| 5267 | 5245 | ||
| 5268 | if (INTEGERP (val) || SYMBOLP (val) && XSYMBOL (val)->gcmarkbit) | 5246 | if (INTEGERP (val) || (SYMBOLP (val) && XSYMBOL (val)->gcmarkbit)) |
| 5269 | continue; | 5247 | continue; |
| 5270 | if (SUB_CHAR_TABLE_P (val)) | 5248 | if (SUB_CHAR_TABLE_P (val)) |
| 5271 | { | 5249 | { |
| @@ -5638,13 +5616,14 @@ mark_terminals (void) | |||
| 5638 | for (t = terminal_list; t; t = t->next_terminal) | 5616 | for (t = terminal_list; t; t = t->next_terminal) |
| 5639 | { | 5617 | { |
| 5640 | eassert (t->name != NULL); | 5618 | eassert (t->name != NULL); |
| 5641 | if (!VECTOR_MARKED_P (t)) | ||
| 5642 | { | ||
| 5643 | #ifdef HAVE_WINDOW_SYSTEM | 5619 | #ifdef HAVE_WINDOW_SYSTEM |
| 5644 | mark_image_cache (t->image_cache); | 5620 | /* If a terminal object is reachable from a stacpro'ed object, |
| 5621 | it might have been marked already. Make sure the image cache | ||
| 5622 | gets marked. */ | ||
| 5623 | mark_image_cache (t->image_cache); | ||
| 5645 | #endif /* HAVE_WINDOW_SYSTEM */ | 5624 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5646 | mark_vectorlike ((struct Lisp_Vector *)t); | 5625 | if (!VECTOR_MARKED_P (t)) |
| 5647 | } | 5626 | mark_vectorlike ((struct Lisp_Vector *)t); |
| 5648 | } | 5627 | } |
| 5649 | } | 5628 | } |
| 5650 | 5629 | ||
| @@ -6193,7 +6172,7 @@ init_alloc (void) | |||
| 6193 | void | 6172 | void |
| 6194 | syms_of_alloc (void) | 6173 | syms_of_alloc (void) |
| 6195 | { | 6174 | { |
| 6196 | DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold, | 6175 | DEFVAR_INT ("gc-cons-threshold", gc_cons_threshold, |
| 6197 | doc: /* *Number of bytes of consing between garbage collections. | 6176 | doc: /* *Number of bytes of consing between garbage collections. |
| 6198 | Garbage collection can happen automatically once this many bytes have been | 6177 | Garbage collection can happen automatically once this many bytes have been |
| 6199 | allocated since the last garbage collection. All data types count. | 6178 | allocated since the last garbage collection. All data types count. |
| @@ -6204,57 +6183,57 @@ By binding this temporarily to a large number, you can effectively | |||
| 6204 | prevent garbage collection during a part of the program. | 6183 | prevent garbage collection during a part of the program. |
| 6205 | See also `gc-cons-percentage'. */); | 6184 | See also `gc-cons-percentage'. */); |
| 6206 | 6185 | ||
| 6207 | DEFVAR_LISP ("gc-cons-percentage", &Vgc_cons_percentage, | 6186 | DEFVAR_LISP ("gc-cons-percentage", Vgc_cons_percentage, |
| 6208 | doc: /* *Portion of the heap used for allocation. | 6187 | doc: /* *Portion of the heap used for allocation. |
| 6209 | Garbage collection can happen automatically once this portion of the heap | 6188 | Garbage collection can happen automatically once this portion of the heap |
| 6210 | has been allocated since the last garbage collection. | 6189 | has been allocated since the last garbage collection. |
| 6211 | If this portion is smaller than `gc-cons-threshold', this is ignored. */); | 6190 | If this portion is smaller than `gc-cons-threshold', this is ignored. */); |
| 6212 | Vgc_cons_percentage = make_float (0.1); | 6191 | Vgc_cons_percentage = make_float (0.1); |
| 6213 | 6192 | ||
| 6214 | DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, | 6193 | DEFVAR_INT ("pure-bytes-used", pure_bytes_used, |
| 6215 | doc: /* Number of bytes of sharable Lisp data allocated so far. */); | 6194 | doc: /* Number of bytes of sharable Lisp data allocated so far. */); |
| 6216 | 6195 | ||
| 6217 | DEFVAR_INT ("cons-cells-consed", &cons_cells_consed, | 6196 | DEFVAR_INT ("cons-cells-consed", cons_cells_consed, |
| 6218 | doc: /* Number of cons cells that have been consed so far. */); | 6197 | doc: /* Number of cons cells that have been consed so far. */); |
| 6219 | 6198 | ||
| 6220 | DEFVAR_INT ("floats-consed", &floats_consed, | 6199 | DEFVAR_INT ("floats-consed", floats_consed, |
| 6221 | doc: /* Number of floats that have been consed so far. */); | 6200 | doc: /* Number of floats that have been consed so far. */); |
| 6222 | 6201 | ||
| 6223 | DEFVAR_INT ("vector-cells-consed", &vector_cells_consed, | 6202 | DEFVAR_INT ("vector-cells-consed", vector_cells_consed, |
| 6224 | doc: /* Number of vector cells that have been consed so far. */); | 6203 | doc: /* Number of vector cells that have been consed so far. */); |
| 6225 | 6204 | ||
| 6226 | DEFVAR_INT ("symbols-consed", &symbols_consed, | 6205 | DEFVAR_INT ("symbols-consed", symbols_consed, |
| 6227 | doc: /* Number of symbols that have been consed so far. */); | 6206 | doc: /* Number of symbols that have been consed so far. */); |
| 6228 | 6207 | ||
| 6229 | DEFVAR_INT ("string-chars-consed", &string_chars_consed, | 6208 | DEFVAR_INT ("string-chars-consed", string_chars_consed, |
| 6230 | doc: /* Number of string characters that have been consed so far. */); | 6209 | doc: /* Number of string characters that have been consed so far. */); |
| 6231 | 6210 | ||
| 6232 | DEFVAR_INT ("misc-objects-consed", &misc_objects_consed, | 6211 | DEFVAR_INT ("misc-objects-consed", misc_objects_consed, |
| 6233 | doc: /* Number of miscellaneous objects that have been consed so far. */); | 6212 | doc: /* Number of miscellaneous objects that have been consed so far. */); |
| 6234 | 6213 | ||
| 6235 | DEFVAR_INT ("intervals-consed", &intervals_consed, | 6214 | DEFVAR_INT ("intervals-consed", intervals_consed, |
| 6236 | doc: /* Number of intervals that have been consed so far. */); | 6215 | doc: /* Number of intervals that have been consed so far. */); |
| 6237 | 6216 | ||
| 6238 | DEFVAR_INT ("strings-consed", &strings_consed, | 6217 | DEFVAR_INT ("strings-consed", strings_consed, |
| 6239 | doc: /* Number of strings that have been consed so far. */); | 6218 | doc: /* Number of strings that have been consed so far. */); |
| 6240 | 6219 | ||
| 6241 | DEFVAR_LISP ("purify-flag", &Vpurify_flag, | 6220 | DEFVAR_LISP ("purify-flag", Vpurify_flag, |
| 6242 | doc: /* Non-nil means loading Lisp code in order to dump an executable. | 6221 | doc: /* Non-nil means loading Lisp code in order to dump an executable. |
| 6243 | This means that certain objects should be allocated in shared (pure) space. | 6222 | This means that certain objects should be allocated in shared (pure) space. |
| 6244 | It can also be set to a hash-table, in which case this table is used to | 6223 | It can also be set to a hash-table, in which case this table is used to |
| 6245 | do hash-consing of the objects allocated to pure space. */); | 6224 | do hash-consing of the objects allocated to pure space. */); |
| 6246 | 6225 | ||
| 6247 | DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, | 6226 | DEFVAR_BOOL ("garbage-collection-messages", garbage_collection_messages, |
| 6248 | doc: /* Non-nil means display messages at start and end of garbage collection. */); | 6227 | doc: /* Non-nil means display messages at start and end of garbage collection. */); |
| 6249 | garbage_collection_messages = 0; | 6228 | garbage_collection_messages = 0; |
| 6250 | 6229 | ||
| 6251 | DEFVAR_LISP ("post-gc-hook", &Vpost_gc_hook, | 6230 | DEFVAR_LISP ("post-gc-hook", Vpost_gc_hook, |
| 6252 | doc: /* Hook run after garbage collection has finished. */); | 6231 | doc: /* Hook run after garbage collection has finished. */); |
| 6253 | Vpost_gc_hook = Qnil; | 6232 | Vpost_gc_hook = Qnil; |
| 6254 | Qpost_gc_hook = intern_c_string ("post-gc-hook"); | 6233 | Qpost_gc_hook = intern_c_string ("post-gc-hook"); |
| 6255 | staticpro (&Qpost_gc_hook); | 6234 | staticpro (&Qpost_gc_hook); |
| 6256 | 6235 | ||
| 6257 | DEFVAR_LISP ("memory-signal-data", &Vmemory_signal_data, | 6236 | DEFVAR_LISP ("memory-signal-data", Vmemory_signal_data, |
| 6258 | doc: /* Precomputed `signal' argument for memory-full error. */); | 6237 | doc: /* Precomputed `signal' argument for memory-full error. */); |
| 6259 | /* We build this in advance because if we wait until we need it, we might | 6238 | /* We build this in advance because if we wait until we need it, we might |
| 6260 | not be able to allocate the memory to hold it. */ | 6239 | not be able to allocate the memory to hold it. */ |
| @@ -6262,7 +6241,7 @@ do hash-consing of the objects allocated to pure space. */); | |||
| 6262 | = pure_cons (Qerror, | 6241 | = pure_cons (Qerror, |
| 6263 | pure_cons (make_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs"), Qnil)); | 6242 | pure_cons (make_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs"), Qnil)); |
| 6264 | 6243 | ||
| 6265 | DEFVAR_LISP ("memory-full", &Vmemory_full, | 6244 | DEFVAR_LISP ("memory-full", Vmemory_full, |
| 6266 | doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); | 6245 | doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); |
| 6267 | Vmemory_full = Qnil; | 6246 | Vmemory_full = Qnil; |
| 6268 | 6247 | ||
| @@ -6272,10 +6251,10 @@ do hash-consing of the objects allocated to pure space. */); | |||
| 6272 | staticpro (&Qchar_table_extra_slots); | 6251 | staticpro (&Qchar_table_extra_slots); |
| 6273 | Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); | 6252 | Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); |
| 6274 | 6253 | ||
| 6275 | DEFVAR_LISP ("gc-elapsed", &Vgc_elapsed, | 6254 | DEFVAR_LISP ("gc-elapsed", Vgc_elapsed, |
| 6276 | doc: /* Accumulated time elapsed in garbage collections. | 6255 | doc: /* Accumulated time elapsed in garbage collections. |
| 6277 | The time is in seconds as a floating point value. */); | 6256 | The time is in seconds as a floating point value. */); |
| 6278 | DEFVAR_INT ("gcs-done", &gcs_done, | 6257 | DEFVAR_INT ("gcs-done", gcs_done, |
| 6279 | doc: /* Accumulated number of garbage collections done. */); | 6258 | doc: /* Accumulated number of garbage collections done. */); |
| 6280 | 6259 | ||
| 6281 | defsubr (&Scons); | 6260 | defsubr (&Scons); |
| @@ -6297,6 +6276,3 @@ The time is in seconds as a floating point value. */); | |||
| 6297 | defsubr (&Sgc_status); | 6276 | defsubr (&Sgc_status); |
| 6298 | #endif | 6277 | #endif |
| 6299 | } | 6278 | } |
| 6300 | |||
| 6301 | /* arch-tag: 6695ca10-e3c5-4c2c-8bc3-ed26a7dda857 | ||
| 6302 | (do not change this comment) */ | ||