diff options
| author | 2024-06-13 21:01:03 -0400 | |
|---|---|---|
| committer | 2024-06-13 21:01:03 -0400 | |
| commit | 5b8775dab611d6a57654356be96c2124cbab7faf (patch) | |
| tree | 06c570f120e9a491978eaded02abb0f68072d2cf /include | |
| parent | hashtable test (diff) | |
add fake struct to help with type checker
Diffstat (limited to 'include')
| -rw-r--r-- | include/uns.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/uns.h b/include/uns.h index 93a859d..d88397c 100644 --- a/include/uns.h +++ b/include/uns.h @@ -38,6 +38,14 @@ typedef UNS_WORD uns_word; typedef UNS_SIGNED_WORD uns_sword; +/* This struct doesn't exist and is used to make a unique pointer for + * type checking. + * + * This pointer must be what was returned from an allocation (i.e. it points + * to the first byte but before any hidden header data). + */ +typedef struct uns_ptr *Uns_ptr; + /** Doubly linked list used to * * 1) Store roots of the GC, @@ -89,8 +97,8 @@ struct uns_gc { */ size_t (*len)(void *); - void (*record_set_ptr)(void *, size_t, void *); - void *(*record_get_ptr)(void *, size_t); + void (*record_set_ptr)(Uns_ptr, size_t, void *); + void *(*record_get_ptr)(Uns_ptr, size_t); }; /** Add a root to the GC. The root must point to valid memory, or NULL. */ |
