mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-07 01:50:32 +02:00
scm_gc_object_address pins its referent
* libguile/gc.h: * libguile/gc.c (scm_gc_pin_object): New function. (scm_gc_object_address): New function, to be used instead of SCM_UNPACK when an object's address is exposed, for example via hashq. * libguile/atomic.c: * libguile/cache-internal.h: * libguile/continuations.c: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/ephemerons.c: * libguile/exceptions.c: * libguile/finalizers.c: * libguile/fluids-internal.h: * libguile/fluids.c: * libguile/foreign.c: * libguile/frames.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/intrinsics.c: * libguile/memoize.c: * libguile/print.c: * libguile/programs.c: * libguile/smob.c: * libguile/struct.c: * libguile/struct.h: * libguile/variable.c: * libguile/vm.c: Use the new functions everywhere that is needed. Because they take a thread, sometimes we have to do some extra plumbing.
This commit is contained in:
parent
b0ce014801
commit
a7d7ff5019
25 changed files with 133 additions and 117 deletions
|
@ -109,7 +109,7 @@ scm_i_print_continuation (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
|
|||
scm_puts ("#<continuation ", port);
|
||||
scm_intprint (continuation->num_stack_items, 10, port);
|
||||
scm_puts (" @ ", port);
|
||||
scm_uintprint (SCM_UNPACK (obj), 16, port);
|
||||
scm_uintprint (scm_gc_object_address (SCM_I_CURRENT_THREAD, obj), 16, port);
|
||||
scm_putc ('>', port);
|
||||
return 1;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ pin_conservative_roots (scm_thread *thread, void *base, size_t size)
|
|||
struct gc_ref ref = gc_resolve_conservative_ref (heap, maybe_ref, 0);
|
||||
if (!gc_ref_is_null (ref))
|
||||
gc_pin_object (mut, ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* James Clark came up with this neat one instruction fix for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue