1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 23:50:47 +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:
Andy Wingo 2025-06-20 11:40:01 +02:00
parent 290a57b1b0
commit f2ad6525e6
35 changed files with 126 additions and 102 deletions

View file

@ -91,8 +91,8 @@ make_continuation_trampoline (struct scm_continuation *cont)
scm_t_bits tag = scm_tc7_program | (nfree << 16) | flags;
struct scm_program *ret =
scm_gc_malloc (sizeof (struct scm_program) + nfree * sizeof(SCM),
"foreign procedure");
scm_allocate_tagged (SCM_I_CURRENT_THREAD,
sizeof (struct scm_program) + nfree * sizeof(SCM));
ret->tag_flags_and_free_variable_count = tag;
ret->code = goto_continuation_code.code;
ret->free_variables[0] = scm_from_continuation (cont);
@ -173,8 +173,8 @@ capture_auxiliary_stack (scm_thread *thread, struct scm_continuation *continuati
continuation->auxiliary_stack_size =
top - (char *) thread->auxiliary_stack_base;
continuation->auxiliary_stack =
scm_gc_malloc (continuation->auxiliary_stack_size,
"continuation auxiliary stack");
scm_allocate_sloppy (SCM_I_CURRENT_THREAD,
continuation->auxiliary_stack_size);
memcpy (continuation->auxiliary_stack, thread->auxiliary_stack_base,
continuation->auxiliary_stack_size);
@ -199,9 +199,9 @@ scm_i_make_continuation (scm_thread *thread, struct scm_vm_cont *vm_cont)
SCM_FLUSH_REGISTER_WINDOWS;
long stack_size = scm_stack_size (thread->continuation_base);
struct scm_continuation *continuation =
scm_gc_malloc (sizeof (struct scm_continuation)
+ stack_size * sizeof (SCM_STACKITEM),
"continuation");
scm_allocate_tagged (SCM_I_CURRENT_THREAD,
sizeof (struct scm_continuation)
+ stack_size * sizeof (SCM_STACKITEM));
continuation->tag = scm_tc16_continuation;
memcpy (continuation->jmpbuf, thread->vm.registers, sizeof (jmp_buf));
pin_conservative_roots (thread, continuation->jmpbuf, sizeof (jmp_buf));