From df4ce930e3a050401042ec949270d3e1a1ac9858 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 22 Jan 2016 16:16:38 +0000 Subject: 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. --- py/qstrdefs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'py/qstrdefs.h') diff --git a/py/qstrdefs.h b/py/qstrdefs.h index d27525f68..935be62b7 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) -- cgit v1.2.3