1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-11 00:00:49 +02:00

Refactor to separate gcbench from gc

This commit is contained in:
Andy Wingo 2022-03-11 10:17:05 +01:00
parent 77ac530360
commit f57a1b8a55
10 changed files with 132 additions and 101 deletions

View file

@ -7,6 +7,7 @@
#include "assert.h"
#include "debug.h"
#include "inline.h"
// The Chase-Lev work-stealing deque, as initially described in "Dynamic
// Circular Work-Stealing Deque" (Chase and Lev, SPAA'05)
@ -236,22 +237,23 @@ static void marker_release(struct context *cx) {
}
struct gcobj;
static inline void marker_visit(struct context *cx, void **loc) __attribute__((always_inline));
static inline void marker_visit(void **loc, void *mark_data) ALWAYS_INLINE;
static inline void marker_trace(struct context *cx,
void (*)(struct context *, struct gcobj *))
__attribute__((always_inline));
ALWAYS_INLINE;
static inline int mark_object(struct context *cx,
struct gcobj *obj) __attribute__((always_inline));
struct gcobj *obj) ALWAYS_INLINE;
static inline void
marker_visit(struct context *cx, void **loc) {
marker_visit(void **loc, void *mark_data) {
struct context *cx = mark_data;
struct gcobj *obj = *loc;
if (obj && mark_object(cx, obj))
mark_deque_push(&context_marker(cx)->deque, (uintptr_t)obj);
}
static inline void
marker_visit_root(struct context *cx, void **loc) {
marker_visit(cx, loc);
marker_visit_root(void **loc, struct context *cx) {
marker_visit(loc, cx);
}
static inline void
marker_trace(struct context *cx,