1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-06 17:40:29 +02:00

Separate tagged and untagged pointerless allocations

Tagged allocations can move; untagged allocations cannot.

* libguile/gc-inline.h:
* libguile/gc-malloc.c:
* libguile/gc.h: Split scm_allocate_pointerless into tagged and untagged
variants.
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/integers.c:
* libguile/intrinsics.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/numbers.c:
* libguile/programs.h:
* libguile/random.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/smob.c:
* libguile/strings.c:
* libguile/vm.c: Use the new functions.
This commit is contained in:
Andy Wingo 2025-07-03 10:10:20 +02:00
parent e21aa9c513
commit 8623e252bf
19 changed files with 85 additions and 72 deletions

View file

@ -308,7 +308,7 @@ scm_new_smob (scm_t_bits tc, scm_t_bits data)
uint32_t all_fields_unmanaged = -1;
all_fields_unmanaged >>= 32 - desc->field_count;
if (desc->unmanaged_fields == all_fields_unmanaged)
ret = scm_allocate_pointerless (thr, sz);
ret = scm_allocate_tagged_pointerless (thr, sz);
else
ret = scm_allocate_tagged (thr, sz);
}
@ -345,7 +345,7 @@ scm_new_double_smob (scm_t_bits tc, scm_t_bits data1,
uint32_t all_fields_unmanaged = -1;
all_fields_unmanaged >>= 32 - desc->field_count;
if (desc->unmanaged_fields == all_fields_unmanaged)
ret = scm_allocate_pointerless (thr, sz);
ret = scm_allocate_tagged_pointerless (thr, sz);
else
ret = scm_allocate_tagged (thr, sz);
}