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

More API-ification

This commit is contained in:
Andy Wingo 2022-08-09 11:35:31 +02:00
parent 4ccb489869
commit d8bcbf2d74
5 changed files with 30 additions and 25 deletions

View file

@ -7,6 +7,9 @@
#define GC_DEBUG 0
#endif
#define GC_ALWAYS_INLINE __attribute__((always_inline))
#define GC_NEVER_INLINE __attribute__((noinline))
#define GC_UNLIKELY(e) __builtin_expect(e, 0)
#define GC_LIKELY(e) __builtin_expect(e, 1)
@ -52,7 +55,7 @@ struct gc_edge {
static inline struct gc_edge gc_edge(void* addr) {
return (struct gc_edge){addr};
}
static struct gc_ref gc_edge_ref(struct gc_edge edge) {
static inline struct gc_ref gc_edge_ref(struct gc_edge edge) {
return *edge.dst;
}
static inline void gc_edge_update(struct gc_edge edge, struct gc_ref ref) {
@ -82,4 +85,10 @@ GC_API_ int gc_option_from_string(const char *str);
GC_API_ int gc_init(int argc, struct gc_option argv[],
struct heap **heap, struct mutator **mutator);
GC_API_ struct mutator* gc_init_for_thread(uintptr_t *stack_base,
struct heap *heap);
GC_API_ void gc_finish_for_thread(struct mutator *mut);
GC_API_ void* gc_call_without_gc(struct mutator *mut, void* (*f)(void*),
void *data) GC_NEVER_INLINE;
#endif // GC_API_H_