diff options
Diffstat (limited to 'src/lib/aplwc_internal.h')
| -rw-r--r-- | src/lib/aplwc_internal.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/aplwc_internal.h b/src/lib/aplwc_internal.h index a7b7030..5320336 100644 --- a/src/lib/aplwc_internal.h +++ b/src/lib/aplwc_internal.h @@ -18,6 +18,7 @@ struct aplwc { uint8_t *unaligned_data; size_t size; struct memory_ptr_frame *memptrs; + struct root_ptr *rootptrs; }; struct memory_ptr_frame { @@ -26,6 +27,12 @@ struct memory_ptr_frame { size_t count; }; +struct root_ptr { + int id; + void *ptr; + struct root_ptr *link; +}; + struct aplwc_line { struct aplwc *aplwc; struct string *text; @@ -95,9 +102,13 @@ struct token_list *memory_alloc_token_list(struct aplwc *, size_t); struct aplwc_value *memory_alloc_aplwc_value(struct aplwc *); struct aplwc_module *memory_alloc_aplwc_module(struct aplwc *); struct module_imports *memory_alloc_module_imports(struct aplwc *, size_t); -void memory_free_root(struct aplwc *, void *); +struct aplwc_ref memory_root_new(struct aplwc *, void *); +void *memory_root_get(struct aplwc_ref); +void memory_root_free(struct aplwc_ref); void memptrs_add(struct aplwc *, struct memory_ptr_frame *, void ***, size_t); void memptrs_remove(struct aplwc *, struct memory_ptr_frame *); +void clear_ref(struct aplwc_ref *); +int valid_ref(struct aplwc_ref); #define MEMPTRS(aplwc, n) \ void **memptrs[n]; \ |