1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-28 22:10:29 +02:00

bdw: Disable thread-local freelists for pointerless allocations

There was a race between GC and popping the head off freelists.  We
could have separate freelists for tagged and untagged normal allocations
though.
This commit is contained in:
Andy Wingo 2025-04-23 17:28:46 +02:00
parent 06b53470f4
commit c9063b8027
7 changed files with 52 additions and 65 deletions

View file

@ -154,12 +154,12 @@ static inline void* gc_allocate_small_fast(struct gc_mutator *mut, size_t size,
GC_ASSERT(size != 0);
GC_ASSERT(size <= gc_allocator_large_threshold());
switch (gc_allocator_kind()) {
case GC_ALLOCATOR_INLINE_BUMP_POINTER:
switch (gc_inline_allocator_kind(kind)) {
case GC_INLINE_ALLOCATOR_BUMP_POINTER:
return gc_allocate_small_fast_bump_pointer(mut, size, kind);
case GC_ALLOCATOR_INLINE_FREELIST:
case GC_INLINE_ALLOCATOR_FREELIST:
return gc_allocate_small_fast_freelist(mut, size, kind);
case GC_ALLOCATOR_INLINE_NONE:
case GC_INLINE_ALLOCATOR_NONE:
return NULL;
default:
GC_CRASH();