diff options
author | Dave Hylands <dhylands@gmail.com> | 2014-06-30 22:49:21 -0700 |
---|---|---|
committer | Dave Hylands <dhylands@gmail.com> | 2014-06-30 22:49:21 -0700 |
commit | 2fe841d2fa022bc7f546ddd77a79eaa0150bdf87 (patch) | |
tree | 73b3359c114fd7462654dff2297e09eecaaca11d /py/gc.c | |
parent | 8993fb6cf0677ce980ab56cbad326e4e6bc47811 (diff) | |
download | micropython-2fe841d2fa022bc7f546ddd77a79eaa0150bdf87.tar.gz micropython-2fe841d2fa022bc7f546ddd77a79eaa0150bdf87.zip |
Try not to cause a MemoryError when raising an exception during nterrupt handling.
Step 1 fixes #732
Diffstat (limited to 'py/gc.c')
-rw-r--r-- | py/gc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 */ \ |