1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-06 09:30:29 +02:00

Allow conservative mmc configs to trace some objects precisely

* api/mmc-attrs.h (gc_allocator_alloc_table_begin_pattern): Unify the
strategies between conservative and precise configurations.  Notably
this mens that TAGGED allocations are traced precisely in
heap-conservative configurations.  Don't pin untagged pointerless
allocations; that is the mutator's responsibility.
* src/mmc.c (compute_trace_kind): Trace tagged objects precisely in all
cases.
(gc_init): Update expectations for alloc table bytes.
This commit is contained in:
Andy Wingo 2025-07-02 10:44:05 +02:00
parent dda1522ab0
commit b874ad5da6
3 changed files with 33 additions and 68 deletions

View file

@ -12,13 +12,12 @@ static inline size_t gc_finalizer_priority_count(void) { return 2; }
static inline int
gc_is_valid_conservative_ref_displacement(uintptr_t displacement) {
#if GC_CONSERVATIVE_ROOTS || GC_CONSERVATIVE_TRACE
// Here is where you would allow tagged heap object references.
return displacement == 0;
#else
if (GC_CONSERVATIVE_ROOTS || GC_CONSERVATIVE_TRACE)
// Here is where you would allow tagged heap object references.
return displacement == 0;
// Shouldn't get here.
GC_CRASH();
#endif
}
// No external objects in simple benchmarks.
@ -40,10 +39,6 @@ static inline void gc_trace_object(struct gc_ref ref,
struct gc_heap *heap,
void *trace_data,
size_t *size) {
#if GC_CONSERVATIVE_TRACE
// Shouldn't get here.
GC_CRASH();
#else
switch (tag_live_alloc_kind(*tag_word(ref))) {
#define SCAN_OBJECT(name, Name, NAME) \
case ALLOC_KIND_##NAME: \
@ -58,7 +53,6 @@ static inline void gc_trace_object(struct gc_ref ref,
default:
GC_CRASH();
}
#endif
}
static inline void visit_roots(struct handle *roots,