1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-06 09:30: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

@ -137,8 +137,8 @@ scm_i_copy_rstate (scm_t_rstate *state)
{
scm_t_rstate *new_state;
new_state = scm_allocate_pointerless (SCM_I_CURRENT_THREAD,
state->rng->rstate_size);
new_state = scm_allocate_tagged_pointerless (SCM_I_CURRENT_THREAD,
state->rng->rstate_size);
return memcpy (new_state, state, state->rng->rstate_size);
}
@ -183,8 +183,8 @@ scm_c_make_rstate (const char *seed, int n)
{
scm_t_rstate *state;
state = scm_allocate_pointerless (SCM_I_CURRENT_THREAD,
scm_the_rng.rstate_size);
state = scm_allocate_tagged_pointerless (SCM_I_CURRENT_THREAD,
scm_the_rng.rstate_size);
state->tag = scm_tc16_random_state;
state->rng = &scm_the_rng;
state->normal_next = 0.0;
@ -197,8 +197,8 @@ scm_c_rstate_from_datum (SCM datum)
{
scm_t_rstate *state;
state = scm_allocate_pointerless (SCM_I_CURRENT_THREAD,
scm_the_rng.rstate_size);
state = scm_allocate_tagged_pointerless (SCM_I_CURRENT_THREAD,
scm_the_rng.rstate_size);
state->tag = scm_tc16_random_state;
state->rng = &scm_the_rng;
state->normal_next = 0.0;