diff options
| author | Richard M. Stallman | 1995-04-11 20:19:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-11 20:19:46 +0000 |
| commit | e81976428cc657a9c7370a14d7ad817257642eff (patch) | |
| tree | 8e4d925b91545d9fd342af9b3f00ce89d55f078c /src/alloc.c | |
| parent | a9cb9b801056e4bcefa95724b07c3fb34d24a6f6 (diff) | |
| download | emacs-e81976428cc657a9c7370a14d7ad817257642eff.tar.gz emacs-e81976428cc657a9c7370a14d7ad817257642eff.zip | |
(inhibit_garbage_collection): New function.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 2436a112ea6..32c5a569fcb 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -155,6 +155,8 @@ int stack_copy_size; | |||
| 155 | /* Non-zero means ignore malloc warnings. Set during initialization. */ | 155 | /* Non-zero means ignore malloc warnings. Set during initialization. */ |
| 156 | int ignore_warnings; | 156 | int ignore_warnings; |
| 157 | 157 | ||
| 158 | Lisp_Object Qgc_cons_threshold; | ||
| 159 | |||
| 158 | static void mark_object (), mark_buffer (), mark_kboards (); | 160 | static void mark_object (), mark_buffer (), mark_kboards (); |
| 159 | static void clear_marks (), gc_sweep (); | 161 | static void clear_marks (), gc_sweep (); |
| 160 | static void compact_strings (); | 162 | static void compact_strings (); |
| @@ -1316,6 +1318,18 @@ int total_free_conses, total_free_markers, total_free_symbols; | |||
| 1316 | int total_free_floats, total_floats; | 1318 | int total_free_floats, total_floats; |
| 1317 | #endif /* LISP_FLOAT_TYPE */ | 1319 | #endif /* LISP_FLOAT_TYPE */ |
| 1318 | 1320 | ||
| 1321 | /* Temporarily prevent garbage collection. */ | ||
| 1322 | |||
| 1323 | int | ||
| 1324 | inhibit_garbage_collection () | ||
| 1325 | { | ||
| 1326 | int count = specpdl_ptr - specpdl; | ||
| 1327 | |||
| 1328 | specbind (Qgc_cons_threshold, make_number ((1 << (VALBITS - 1)) - 1)); | ||
| 1329 | |||
| 1330 | return count; | ||
| 1331 | } | ||
| 1332 | |||
| 1319 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", | 1333 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", |
| 1320 | "Reclaim storage for Lisp objects no longer needed.\n\ | 1334 | "Reclaim storage for Lisp objects no longer needed.\n\ |
| 1321 | Returns info on amount of space in use:\n\ | 1335 | Returns info on amount of space in use:\n\ |
| @@ -2419,6 +2433,9 @@ which includes both saved text and other data."); | |||
| 2419 | = Fcons (Qerror, Fcons (build_string ("Memory exhausted--use M-x save-some-buffers RET"), Qnil)); | 2433 | = Fcons (Qerror, Fcons (build_string ("Memory exhausted--use M-x save-some-buffers RET"), Qnil)); |
| 2420 | staticpro (&memory_signal_data); | 2434 | staticpro (&memory_signal_data); |
| 2421 | 2435 | ||
| 2436 | staticpro (&Qgc_cons_threshold); | ||
| 2437 | Qgc_cons_threshold = intern ("gc-cons-threshold"); | ||
| 2438 | |||
| 2422 | defsubr (&Scons); | 2439 | defsubr (&Scons); |
| 2423 | defsubr (&Slist); | 2440 | defsubr (&Slist); |
| 2424 | defsubr (&Svector); | 2441 | defsubr (&Svector); |