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.c | |
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.c')
-rw-r--r-- | py/gc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -433,7 +433,8 @@ void gc_info(gc_info_t *info) { GC_EXIT(); } -void *gc_alloc(size_t n_bytes, bool has_finaliser) { +void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) { + bool has_finaliser = alloc_flags & GC_ALLOC_FLAG_HAS_FINALISER; size_t n_blocks = ((n_bytes + BYTES_PER_BLOCK - 1) & (~(BYTES_PER_BLOCK - 1))) / BYTES_PER_BLOCK; DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks)\n", n_bytes, n_blocks); |