diff options
author | Damien George <damien.p.george@gmail.com> | 2016-01-22 16:16:38 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-01-24 09:12:06 +0000 |
commit | df4ce930e3a050401042ec949270d3e1a1ac9858 (patch) | |
tree | 059b90a92dc91447c4eaa9eb2d04437c6ed1be2c /py/qstrdefs.h | |
parent | 42a6364a311a96e376f3f1e2677007ee603b2ad6 (diff) | |
download | micropython-df4ce930e3a050401042ec949270d3e1a1ac9858.tar.gz micropython-df4ce930e3a050401042ec949270d3e1a1ac9858.zip |
py/modmicropython: Add stack_use, heap_lock and heap_unlock functions.
micropython.stack_use() returns an integer being the number of bytes used
on the stack.
micropython.heap_lock() and heap_unlock() can be used to prevent the
memory manager from allocating anything on the heap. Calls to these are
allowed to be nested.
Diffstat (limited to 'py/qstrdefs.h')
-rw-r--r-- | py/qstrdefs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/qstrdefs.h b/py/qstrdefs.h index d27525f685..935be62b7f 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -432,6 +432,13 @@ Q(mem_peak) #endif Q(mem_info) Q(qstr_info) +#if MICROPY_STACK_CHECK +Q(stack_use) +#endif +#endif +#if MICROPY_ENABLE_GC +Q(heap_lock) +Q(heap_unlock) #endif #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0) |