aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 035b45864d9..e14b0d577a8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6053,12 +6053,17 @@ garbage_collect_1 (struct gcstat *gcst)
6053 struct timespec start; 6053 struct timespec start;
6054 byte_ct tot_before = 0; 6054 byte_ct tot_before = 0;
6055 6055
6056 specbind (Qsymbols_with_pos_enabled, Qnil);
6057
6056 eassert (weak_hash_tables == NULL); 6058 eassert (weak_hash_tables == NULL);
6057 6059
6058 /* Can't GC if pure storage overflowed because we can't determine 6060 /* Can't GC if pure storage overflowed because we can't determine
6059 if something is a pure object or not. */ 6061 if something is a pure object or not. */
6060 if (pure_bytes_used_before_overflow) 6062 if (pure_bytes_used_before_overflow)
6061 return false; 6063 {
6064 unbind_to (count, Qnil);
6065 return false;
6066 }
6062 6067
6063 /* Record this function, so it appears on the profiler's backtraces. */ 6068 /* Record this function, so it appears on the profiler's backtraces. */
6064 record_in_backtrace (QAutomatic_GC, 0, 0); 6069 record_in_backtrace (QAutomatic_GC, 0, 0);
@@ -6249,6 +6254,7 @@ garbage_collect_1 (struct gcstat *gcst)
6249 malloc_probe (min (swept, SIZE_MAX)); 6254 malloc_probe (min (swept, SIZE_MAX));
6250 } 6255 }
6251 6256
6257 unbind_to (count, Qnil);
6252 return true; 6258 return true;
6253} 6259}
6254 6260
@@ -6276,11 +6282,9 @@ returns nil, because real GC can't be done.
6276See Info node `(elisp)Garbage Collection'. */) 6282See Info node `(elisp)Garbage Collection'. */)
6277 (void) 6283 (void)
6278{ 6284{
6279 ptrdiff_t count = SPECPDL_INDEX ();
6280 struct gcstat gcst; 6285 struct gcstat gcst;
6281 specbind (Qsymbols_with_pos_enabled, Qnil);
6282 if (!garbage_collect_1 (&gcst)) 6286 if (!garbage_collect_1 (&gcst))
6283 return unbind_to (count, Qnil); 6287 return Qnil;
6284 6288
6285 Lisp_Object total[] = { 6289 Lisp_Object total[] = {
6286 list4 (Qconses, make_fixnum (sizeof (struct Lisp_Cons)), 6290 list4 (Qconses, make_fixnum (sizeof (struct Lisp_Cons)),
@@ -6315,7 +6319,7 @@ See Info node `(elisp)Garbage Collection'. */)
6315 make_int ((mallinfo ().fordblks + 1023) >> 10)), 6319 make_int ((mallinfo ().fordblks + 1023) >> 10)),
6316#endif 6320#endif
6317 }; 6321 };
6318 return unbind_to (count, CALLMANY (Flist, total)); 6322 return CALLMANY (Flist, total);
6319} 6323}
6320 6324
6321/* Mark Lisp objects in glyph matrix MATRIX. Currently the 6325/* Mark Lisp objects in glyph matrix MATRIX. Currently the