aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 11afdfd7cc0..0fc79fe68ac 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -621,6 +621,12 @@ buffer_memory_full (ptrdiff_t nbytes)
621#endif 621#endif
622} 622}
623 623
624/* A common multiple of the positive integers A and B. Ideally this
625 would be the least common multiple, but there's no way to do that
626 as a constant expression in C, so do the best that we can easily do. */
627#define COMMON_MULTIPLE(a, b) \
628 ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b))
629
624#ifndef XMALLOC_OVERRUN_CHECK 630#ifndef XMALLOC_OVERRUN_CHECK
625#define XMALLOC_OVERRUN_CHECK_OVERHEAD 0 631#define XMALLOC_OVERRUN_CHECK_OVERHEAD 0
626#else 632#else
@@ -7024,10 +7030,16 @@ sweep_symbols (void)
7024 { 7030 {
7025 if (!sym->s.gcmarkbit) 7031 if (!sym->s.gcmarkbit)
7026 { 7032 {
7027 if (sym->s.redirect == SYMBOL_LOCALIZED 7033 if (sym->s.redirect == SYMBOL_LOCALIZED)
7028 /* Already freed? */ 7034 {
7029 && !EQ (sym->s.function, Vdead)) 7035 xfree (SYMBOL_BLV (&sym->s));
7030 xfree (SYMBOL_BLV (&sym->s)); 7036 /* At every GC we sweep all symbol_blocks and rebuild the
7037 symbol_free_list, so those symbols which stayed unused
7038 between the two will be re-swept.
7039 So we have to make sure we don't re-free this blv next
7040 time we sweep this symbol_block (bug#29066). */
7041 sym->s.redirect = SYMBOL_PLAINVAL;
7042 }
7031 sym->s.next = symbol_free_list; 7043 sym->s.next = symbol_free_list;
7032 symbol_free_list = &sym->s; 7044 symbol_free_list = &sym->s;
7033 symbol_free_list->function = Vdead; 7045 symbol_free_list->function = Vdead;