summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-01 14:26:37 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-01 14:26:37 +0100
commitf065344d3b5d88bc09e0028382f26ab60de2b5b2 (patch)
treeea4e1b3f43611332c55a561c0e025d286f7aca09 /py/gc.c
parentaa47f3968bdb46c67b6150eb7637d1cbd1e76767 (diff)
parent2fe841d2fa022bc7f546ddd77a79eaa0150bdf87 (diff)
downloadmicropython-f065344d3b5d88bc09e0028382f26ab60de2b5b2.tar.gz
micropython-f065344d3b5d88bc09e0028382f26ab60de2b5b2.zip
Merge branch 'preserve-except' of github.com:dhylands/micropython into dhylands-preserve-except
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/gc.c b/py/gc.c
index 65bfea0b35..7aa5bc326e 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -172,6 +172,10 @@ void gc_unlock(void) {
gc_lock_depth--;
}
+bool gc_is_locked(void) {
+ return gc_lock_depth != 0;
+}
+
#define VERIFY_PTR(ptr) ( \
(ptr & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \
&& ptr >= (machine_uint_t)gc_pool_start /* must be above start of pool */ \