blob: ec487df9d884e061f6b3ca17ea2131baae9cc0e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef GC_EDGE_H
#define GC_EDGE_H
#include "gc-ref.h"
struct gc_edge {
struct gc_ref *dst;
};
static inline struct gc_edge gc_edge(void* addr) {
return (struct gc_edge){addr};
}
static inline struct gc_ref gc_edge_ref(struct gc_edge edge) {
return *edge.dst;
}
static inline struct gc_ref* gc_edge_loc(struct gc_edge edge) {
return edge.dst;
}
static inline uintptr_t gc_edge_address(struct gc_edge edge) {
return (uintptr_t)gc_edge_loc(edge);
}
static inline void gc_edge_update(struct gc_edge edge, struct gc_ref ref) {
*edge.dst = ref;
}
#endif // GC_EDGE_H
|