aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorYuan Fu2022-08-29 11:41:10 -0700
committerYuan Fu2022-08-29 11:41:10 -0700
commit77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273 (patch)
tree969937ec44ce5ddf9447b074aa15314e0b9e8e95 /src/alloc.c
parente98b4715bb986524bde9356b62429af9786ae716 (diff)
parentdf2f6fb7fc4b79834ae40db8be2ccdc1e4a273f1 (diff)
downloademacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.tar.gz
emacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.zip
Merge remote-tracking branch 'origin/master' into feature/tree-sitter
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 14c3a4cb8d7..ced7c73cba7 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -479,7 +479,7 @@ enum mem_type
479static bool 479static bool
480deadp (Lisp_Object x) 480deadp (Lisp_Object x)
481{ 481{
482 return EQ (x, dead_object ()); 482 return BASE_EQ (x, dead_object ());
483} 483}
484 484
485#ifdef GC_MALLOC_CHECK 485#ifdef GC_MALLOC_CHECK
@@ -5334,6 +5334,7 @@ static void *
5334pure_alloc (size_t size, int type) 5334pure_alloc (size_t size, int type)
5335{ 5335{
5336 void *result; 5336 void *result;
5337 static bool pure_overflow_warned = false;
5337 5338
5338 again: 5339 again:
5339 if (type >= 0) 5340 if (type >= 0)
@@ -5358,6 +5359,12 @@ pure_alloc (size_t size, int type)
5358 if (pure_bytes_used <= pure_size) 5359 if (pure_bytes_used <= pure_size)
5359 return result; 5360 return result;
5360 5361
5362 if (!pure_overflow_warned)
5363 {
5364 message ("Pure Lisp storage overflowed");
5365 pure_overflow_warned = true;
5366 }
5367
5361 /* Don't allocate a large amount here, 5368 /* Don't allocate a large amount here,
5362 because it might get mmap'd and then its address 5369 because it might get mmap'd and then its address
5363 might not be usable. */ 5370 might not be usable. */
@@ -5375,9 +5382,6 @@ pure_alloc (size_t size, int type)
5375 goto again; 5382 goto again;
5376} 5383}
5377 5384
5378
5379#ifdef HAVE_UNEXEC
5380
5381/* Print a warning if PURESIZE is too small. */ 5385/* Print a warning if PURESIZE is too small. */
5382 5386
5383void 5387void
@@ -5388,8 +5392,6 @@ check_pure_size (void)
5388 " bytes needed)"), 5392 " bytes needed)"),
5389 pure_bytes_used + pure_bytes_used_before_overflow); 5393 pure_bytes_used + pure_bytes_used_before_overflow);
5390} 5394}
5391#endif
5392
5393 5395
5394/* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from 5396/* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from
5395 the non-Lisp data pool of the pure storage, and return its start 5397 the non-Lisp data pool of the pure storage, and return its start
@@ -6224,6 +6226,10 @@ garbage_collect (void)
6224 mark_xterm (); 6226 mark_xterm ();
6225#endif 6227#endif
6226 6228
6229#ifdef HAVE_NS
6230 mark_nsterm ();
6231#endif
6232
6227 /* Everything is now marked, except for the data in font caches, 6233 /* Everything is now marked, except for the data in font caches,
6228 undo lists, and finalizers. The first two are compacted by 6234 undo lists, and finalizers. The first two are compacted by
6229 removing an items which aren't reachable otherwise. */ 6235 removing an items which aren't reachable otherwise. */
@@ -6282,6 +6288,11 @@ garbage_collect (void)
6282 /* GC is complete: now we can run our finalizer callbacks. */ 6288 /* GC is complete: now we can run our finalizer callbacks. */
6283 run_finalizers (&doomed_finalizers); 6289 run_finalizers (&doomed_finalizers);
6284 6290
6291#ifdef HAVE_WINDOW_SYSTEM
6292 /* Eject unused image cache entries. */
6293 image_prune_animation_caches (false);
6294#endif
6295
6285 if (!NILP (Vpost_gc_hook)) 6296 if (!NILP (Vpost_gc_hook))
6286 { 6297 {
6287 specpdl_ref gc_count = inhibit_garbage_collection (); 6298 specpdl_ref gc_count = inhibit_garbage_collection ();