summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-01 14:28:40 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-01 14:28:40 +0100
commit5fc580475f5eba8248de86a4148090e63f777372 (patch)
tree5261ef47c946e0db2b619829513945889e7e4ab6 /py/gc.c
parentaa47f3968bdb46c67b6150eb7637d1cbd1e76767 (diff)
parentf0b29729aa086892a2dc6640a9fe619bb723e5fa (diff)
downloadmicropython-5fc580475f5eba8248de86a4148090e63f777372.tar.gz
micropython-5fc580475f5eba8248de86a4148090e63f777372.zip
Merge branch '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 */ \