mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-10 07:50:24 +02:00
Refactor embedder interface for conservative GC
Now users don't have to #ifdef on conservative vs precise tracing; it's just a generic embedder concern.
This commit is contained in:
parent
910b62af8f
commit
c614c2e40b
14 changed files with 109 additions and 198 deletions
|
@ -1,21 +0,0 @@
|
|||
#ifndef PRECISE_ROOTS_API_H
|
||||
#define PRECISE_ROOTS_API_H
|
||||
|
||||
#include "precise-roots-types.h"
|
||||
|
||||
#define HANDLE_TO(T) union { T* v; struct handle handle; }
|
||||
#define HANDLE_REF(h) h.v
|
||||
#define HANDLE_SET(h,val) do { h.v = val; } while (0)
|
||||
#define PUSH_HANDLE(cx, h) push_handle(&(cx)->roots.roots, &h.handle)
|
||||
#define POP_HANDLE(cx) pop_handle(&(cx)->roots.roots)
|
||||
|
||||
static inline void push_handle(struct handle **roots, struct handle *handle) {
|
||||
handle->next = *roots;
|
||||
*roots = handle;
|
||||
}
|
||||
|
||||
static inline void pop_handle(struct handle **roots) {
|
||||
*roots = (*roots)->next;
|
||||
}
|
||||
|
||||
#endif // PRECISE_ROOTS_API_H
|
Loading…
Add table
Add a link
Reference in a new issue