diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2018-10-26 22:27:44 +0300 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-12-20 17:52:16 +1100 |
commit | 5ed578e5b48730606536ded9a711223ae9a70262 (patch) | |
tree | c6e7cd4b0073f3f9eb986da5f62df36d3bd765b3 /py/gc.h | |
parent | a261d8b615298a7ade5c2aebf50e97d089c56667 (diff) |
py/gc: Adjust gc_alloc() signature to be able to accept multiple flags.
The older "bool has_finaliser" gets recast as GC_ALLOC_FLAG_HAS_FINALISER=1
so this is a backwards compatible change to the signature. Since bool gets
implicitly converted to 1 this patch doesn't include conversion of all
calls.
Diffstat (limited to 'py/gc.h')
-rw-r--r-- | py/gc.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -48,7 +48,11 @@ void gc_collect_end(void); // Use this function to sweep the whole heap and run all finalisers void gc_sweep_all(void); -void *gc_alloc(size_t n_bytes, bool has_finaliser); +enum { + GC_ALLOC_FLAG_HAS_FINALISER = 1, +}; + +void *gc_alloc(size_t n_bytes, unsigned int alloc_flags); void gc_free(void *ptr); // does not call finaliser size_t gc_nbytes(const void *ptr); void *gc_realloc(void *ptr, size_t n_bytes, bool allow_move); |