x-engine-c v0.2.13
The C engine for x-lang
Loading...
Searching...
No Matches
x-heap.h
Go to the documentation of this file.
1#ifndef X_HEAP_H
2#define X_HEAP_H
3
43#include "x-base.h"
44
45#ifndef X_HEAP
46#warning X_HEAP is required
47#else /* X_HEAP */
48
65typedef x_obj_t *(*x_heap_mark_fn_t)(x_obj_t *, x_obj_t *, x_obj_flag_t);
66
77typedef void (*x_heap_free_fn_t)(x_obj_t *, x_obj_t *);
78
90x_obj_t *x_heap_tree_mark(x_obj_t *p_base, x_obj_t *p_obj, x_obj_flag_t flags);
91
93x_obj_t *x_heap_sweep(x_obj_t *p_base, x_obj_t *p_obj, x_obj_flag_t flags);
94
96x_obj_t *x_heap_chain_clear(x_obj_t *p_node, x_obj_flag_t flags);
97
120void x_heap_mark_hook_add(x_obj_t *p_base, x_obj_t *p_hook);
121
123void x_heap_free_hook_add(x_obj_t *p_base, x_obj_t *p_hook);
124
126void x_heap_mark_root_add(x_obj_t *p_base, x_obj_t *p_root);
127
157#define x_heap_root_chain(B) \
158 x_firstobj(x_base_field_heap_root_chain(B))
159
171#define x_heap_root_slot(B) \
172 (x_base_isset(B) ? &x_heap_root_chain(B) : (x_obj_t **)NULL)
173
181#define x_heap_root_push(p_slot, node) \
182 ((p_slot) != NULL \
183 ? (void)(x_obj_heap((x_obj_t *)(node)) = *(p_slot), \
184 *(p_slot) = (x_obj_t *)(node)) \
185 : (void)0)
186
193#define x_heap_root_pop(p_slot) \
194 ((p_slot) != NULL \
195 ? (void)(*(p_slot) = x_obj_heap(*(p_slot))) \
196 : (void)0)
197
199x_obj_t *x_heap_root_chain_mark(x_obj_t *p_base, x_obj_flag_t flags);
200
203#endif /* X_HEAP */
204
205#endif /* X_HEAP_H */
Definition x-obj.h:212
Base environment object – the root context for evaluation.
enum x_obj_flag_enum x_obj_flag_t