mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-01 23:30:28 +02:00
Convert scm_gc_malloc* calls to scm_allocate*
* libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/chooks.c: * libguile/continuations.c: * libguile/control.c: * libguile/dynstack.c: * libguile/ephemerons.c: * libguile/filesys.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/gsubr.c: * libguile/hashtab.c: * libguile/i18n.c: * libguile/integers.c: * libguile/intrinsics.c: * libguile/load.c: * libguile/loader.c: * libguile/macros.c: * libguile/numbers.c: * libguile/options.c: * libguile/ports.c: * libguile/programs.h: * libguile/random.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/smob.c: * libguile/srfi-14.c: * libguile/strings.c: * libguile/struct.c: * libguile/threads.c: * libguile/threads.h: * libguile/values.c: * libguile/vm.c: Convert all calls to scm_gc_malloc_pointerless to scm_allocate_pointerless. Convert scm_gc_malloc to either scm_allocate_tagged or scm_allocate_sloppy, depending on whether the value can be precisely traced or not.
This commit is contained in:
parent
290a57b1b0
commit
f2ad6525e6
35 changed files with 126 additions and 102 deletions
|
@ -50,6 +50,7 @@
|
|||
#include "stime.h"
|
||||
#include "strings.h"
|
||||
#include "symbols.h"
|
||||
#include "threads.h"
|
||||
#include "variable.h"
|
||||
#include "vectors.h"
|
||||
|
||||
|
@ -136,8 +137,8 @@ scm_i_copy_rstate (scm_t_rstate *state)
|
|||
{
|
||||
scm_t_rstate *new_state;
|
||||
|
||||
new_state = scm_gc_malloc_pointerless (state->rng->rstate_size,
|
||||
"random-state");
|
||||
new_state = scm_allocate_pointerless (SCM_I_CURRENT_THREAD,
|
||||
state->rng->rstate_size);
|
||||
return memcpy (new_state, state, state->rng->rstate_size);
|
||||
}
|
||||
|
||||
|
@ -182,8 +183,8 @@ scm_c_make_rstate (const char *seed, int n)
|
|||
{
|
||||
scm_t_rstate *state;
|
||||
|
||||
state = scm_gc_malloc_pointerless (scm_the_rng.rstate_size,
|
||||
"random-state");
|
||||
state = scm_allocate_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;
|
||||
|
@ -196,8 +197,8 @@ scm_c_rstate_from_datum (SCM datum)
|
|||
{
|
||||
scm_t_rstate *state;
|
||||
|
||||
state = scm_gc_malloc_pointerless (scm_the_rng.rstate_size,
|
||||
"random-state");
|
||||
state = scm_allocate_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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue