1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-05 17:20:18 +02:00

Dynstack snapshot relocation

* libguile/dynstack.c (scm_trace_dynstack): Allow for snapshots to be
relocated.
This commit is contained in:
Andy Wingo 2025-07-01 15:32:21 +02:00
parent c379fba9a9
commit 2e0c7c9696

View file

@ -140,9 +140,17 @@ scm_trace_dynstack (struct scm_dynstack *dynstack,
void *trace_data),
struct gc_heap *heap, void *trace_data)
{
scm_t_bits *walk;
if (dynstack->tag != -1) {
/* If the tag is set, this is a snapshot. If the snapshot is
evacuated, we need to relocate our interior pointers. */
ptrdiff_t reloc = dynstack->inline_storage - dynstack->base;
dynstack->base += reloc;
dynstack->limit += reloc;
dynstack->top += reloc;
}
for (walk = scm_dynstack_prev (dynstack->top); walk;
for (scm_t_bits *walk = scm_dynstack_prev (dynstack->top);
walk;
walk = scm_dynstack_prev (walk))
{
scm_t_bits tag = scm_dynstack_tag (walk);