1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-09 07:00:23 +02:00
guile/precise-roots-embedder.h
Andy Wingo 053dbf0b61 Pass heap to tracer functions
This will allow conservative intra-heap edges.  Hopefully no overhead?
2022-10-25 14:25:55 +02:00

61 lines
2.2 KiB
C

#ifndef PRECISE_ROOTS_EMBEDDER_H
#define PRECISE_ROOTS_EMBEDDER_H
#include "gc-edge.h"
#include "gc-embedder-api.h"
#include "precise-roots-types.h"
static inline int gc_has_mutator_conservative_roots(void) {
return 0;
}
static inline int gc_mutator_conservative_roots_may_be_interior(void) {
return 0;
}
static inline int gc_has_global_conservative_roots(void) {
return 0;
}
static inline int gc_has_conservative_intraheap_edges(void) {
return 0;
}
static inline int
gc_is_valid_conservative_ref_displacement(uintptr_t displacement) {
GC_CRASH();
}
static inline int
gc_conservative_ref_might_be_a_heap_object(struct gc_conservative_ref ref,
int possibly_interior) {
GC_CRASH();
}
static inline void visit_roots(struct handle *roots,
void (*trace_edge)(struct gc_edge edge,
struct gc_heap *heap,
void *trace_data),
struct gc_heap *heap,
void *trace_data) {
for (struct handle *h = roots; h; h = h->next)
trace_edge(gc_edge(&h->v), heap, trace_data);
}
static inline void gc_trace_mutator_roots(struct gc_mutator_roots *roots,
void (*trace_edge)(struct gc_edge edge,
struct gc_heap *heap,
void *trace_data),
struct gc_heap *heap,
void *trace_data) {
if (roots)
visit_roots(roots->roots, trace_edge, heap, trace_data);
}
static inline void gc_trace_heap_roots(struct gc_heap_roots *roots,
void (*trace_edge)(struct gc_edge edge,
struct gc_heap *heap,
void *trace_data),
struct gc_heap *heap,
void *trace_data) {
if (roots)
visit_roots(roots->roots, trace_edge, heap, trace_data);
}
#endif // PRECISE_ROOTS_EMBEDDER_H