summaryrefslogtreecommitdiff
path: root/py/gc.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-01-12 23:32:51 -0500
committerDan Halbert <halbert@halwitz.org>2020-01-12 23:32:51 -0500
commit9e7f8743c2725c1818033e348e8d542ec7539045 (patch)
tree200b6b76c2ee13e63a6a3a78545735092dedd4f6 /py/gc.c
parent346ce3b73b532d2776e660e0e92c5d79c699880e (diff)
fix CCCD bonding store; avoid excessive bonding writes
Diffstat (limited to 'py/gc.c')
-rwxr-xr-xpy/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/gc.c b/py/gc.c
index 5e631f5ed..fef67f61b 100755
--- a/py/gc.c
+++ b/py/gc.c
@@ -464,6 +464,10 @@ void gc_info(gc_info_t *info) {
GC_EXIT();
}
+bool gc_alloc_possible(void) {
+ return MP_STATE_MEM(gc_pool_start) != 0;
+}
+
// We place long lived objects at the end of the heap rather than the start. This reduces
// fragmentation by localizing the heap churn to one portion of memory (the start of the heap.)
void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) {