1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 08:40:19 +02:00

Add gc_allocation_kind argument to gc_allocate

Adapt all users.  Will eventually allow for mmc to have untagged
allocations.
This commit is contained in:
Andy Wingo 2025-03-07 10:58:05 +01:00
parent 5bddd522cf
commit 521cd44ebd
13 changed files with 158 additions and 75 deletions

View file

@ -6,14 +6,14 @@
static inline void*
gc_allocate_with_kind(struct gc_mutator *mut, enum alloc_kind kind, size_t bytes) {
void *obj = gc_allocate(mut, bytes);
void *obj = gc_allocate(mut, bytes, GC_ALLOCATION_TAGGED);
*tag_word(gc_ref_from_heap_object(obj)) = tag_live(kind);
return obj;
}
static inline void*
gc_allocate_pointerless_with_kind(struct gc_mutator *mut, enum alloc_kind kind, size_t bytes) {
void *obj = gc_allocate_pointerless(mut, bytes);
void *obj = gc_allocate(mut, bytes, GC_ALLOCATION_TAGGED_POINTERLESS);
*tag_word(gc_ref_from_heap_object(obj)) = tag_live(kind);
return obj;
}