aboutsummaryrefslogtreecommitdiff
path: root/py/gc.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2018-10-26 22:27:44 +0300
committerDamien George <damien.p.george@gmail.com>2018-12-20 17:52:16 +1100
commit5ed578e5b48730606536ded9a711223ae9a70262 (patch)
treec6e7cd4b0073f3f9eb986da5f62df36d3bd765b3 /py/gc.c
parenta261d8b615298a7ade5c2aebf50e97d089c56667 (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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/gc.c b/py/gc.c
index 072572435..2965059a1 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -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);