1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-08 18:40:23 +02:00

Precise tracing works with heap-conservative-mmc

* libguile/ports.c (scm_make_port_type): Pin the ptob.
* libguile/threads.c (scm_trace_thread_roots): No need to trace dynstack
roots; we will do so within scm_trace_thread.
* libguile/trace.h (scm_trace_struct): Fix arg order to logbit?.
(scm_trace_ephemeron_table): Indentation fix.
(scm_trace_pointer): Actually trace the protected objects.
(scm_trace_vm):
(scm_trace_active_dynamic_state):
(scm_trace_thread): Fix to trace missing references.
(scm_trace_port): Trace the ptob and write_buf_aux.
(scm_trace_random_state): Add comment about rng being static.
* libguile/whippet-embedder.h (gc_is_valid_conservative_ref_displacement):
Don't hide behind an ifdef.
This commit is contained in:
Andy Wingo 2025-07-02 15:11:03 +02:00
parent 24f5e43e61
commit e51cf4bf65
5 changed files with 54 additions and 63 deletions

View file

@ -248,10 +248,8 @@ scm_make_port_type (char *name,
size_t (*write) (SCM port, SCM src, size_t start,
size_t count))
{
scm_t_port_type *desc;
desc = scm_allocate_tagged (SCM_I_CURRENT_THREAD, sizeof (*desc));
memset (desc, 0, sizeof (*desc));
struct scm_thread *thr = SCM_I_CURRENT_THREAD;
scm_t_port_type *desc = scm_allocate_tagged (thr, sizeof (*desc));
desc->tag = scm_tc7_port_type;
desc->name = name;
@ -266,6 +264,10 @@ scm_make_port_type (char *name,
desc->stream_mode = SCM_PORT_STREAM_CONSERVATIVE;
scm_make_port_classes (desc);
// Since we have to reach into the ptob to get stream mode when
// collecting ports, let's pin the ptob.
scm_gc_pin_object (thr, SCM_PACK_POINTER (desc));
return desc;
}