summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/gc.h')
-rw-r--r--py/gc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/py/gc.h b/py/gc.h
index dd6f60dbd7..2ae7bbe5f0 100644
--- a/py/gc.h
+++ b/py/gc.h
@@ -1,8 +1,16 @@
void gc_init(void *start, void *end);
+
+// These lock/unlock functions can be nested.
+// They can be used to prevent the GC from allocating/freeing.
+void gc_lock(void);
+void gc_unlock(void);
+
+// A given port must implement gc_collect by using the other collect functions.
+void gc_collect(void);
void gc_collect_start(void);
void gc_collect_root(void **ptrs, machine_uint_t len);
void gc_collect_end(void);
-void gc_collect(void);
+
void *gc_alloc(machine_uint_t n_bytes, bool has_finaliser);
void gc_free(void *ptr);
machine_uint_t gc_nbytes(void *ptr);