diff options
| author | Stefan Monnier | 2023-09-12 14:06:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-09-12 14:06:54 -0400 |
| commit | 1e1f3e30efd650af9d995575ce23c585aaeb6e78 (patch) | |
| tree | b52f53f7e32b69b959edd2bad0c7bc4a0d48e67f /src/alloc.c | |
| parent | ff87aecf8554042b043467a7aaff1a758df0bbae (diff) | |
| download | emacs-1e1f3e30efd650af9d995575ce23c585aaeb6e78.tar.gz emacs-1e1f3e30efd650af9d995575ce23c585aaeb6e78.zip | |
* src/alloc.c (garbage_collect): Run `post-gc-hook` later (bug#65700)
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c index c0086a70fc1..fbb1c6ed6c3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6595,13 +6595,6 @@ garbage_collect (void) | |||
| 6595 | image_prune_animation_caches (false); | 6595 | image_prune_animation_caches (false); |
| 6596 | #endif | 6596 | #endif |
| 6597 | 6597 | ||
| 6598 | if (!NILP (Vpost_gc_hook)) | ||
| 6599 | { | ||
| 6600 | specpdl_ref gc_count = inhibit_garbage_collection (); | ||
| 6601 | safe_run_hooks (Qpost_gc_hook); | ||
| 6602 | unbind_to (gc_count, Qnil); | ||
| 6603 | } | ||
| 6604 | |||
| 6605 | /* Accumulate statistics. */ | 6598 | /* Accumulate statistics. */ |
| 6606 | if (FLOATP (Vgc_elapsed)) | 6599 | if (FLOATP (Vgc_elapsed)) |
| 6607 | { | 6600 | { |
| @@ -6620,6 +6613,13 @@ garbage_collect (void) | |||
| 6620 | if (tot_after < tot_before) | 6613 | if (tot_after < tot_before) |
| 6621 | malloc_probe (min (tot_before - tot_after, SIZE_MAX)); | 6614 | malloc_probe (min (tot_before - tot_after, SIZE_MAX)); |
| 6622 | } | 6615 | } |
| 6616 | |||
| 6617 | if (!NILP (Vpost_gc_hook)) | ||
| 6618 | { | ||
| 6619 | specpdl_ref gc_count = inhibit_garbage_collection (); | ||
| 6620 | safe_run_hooks (Qpost_gc_hook); | ||
| 6621 | unbind_to (gc_count, Qnil); | ||
| 6622 | } | ||
| 6623 | } | 6623 | } |
| 6624 | 6624 | ||
| 6625 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", | 6625 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", |