summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-09 16:44:43 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-09 16:44:43 +0100
commit4091445612a14451590064f337eeb190d969d243 (patch)
tree5c373e6afd198e5eaf5f935542779d8067155878 /py
parent3556e45711c3b7ec712748d013e678d035185bdd (diff)
downloadmicropython-4091445612a14451590064f337eeb190d969d243.tar.gz
micropython-4091445612a14451590064f337eeb190d969d243.zip
py: Add #if guard around gc-specific code.
Diffstat (limited to 'py')
-rw-r--r--py/runtime.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 71979c09b6..6efab0480c 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1208,11 +1208,15 @@ mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_i
void *m_malloc_fail(size_t num_bytes) {
DEBUG_printf("memory allocation failed, allocating " UINT_FMT " bytes\n", num_bytes);
- if (gc_is_locked()) {
- nlr_raise(mp_obj_new_exception_msg(& mp_type_MemoryError,
+ if (0) {
+ // dummy
+ #if MICROPY_ENABLE_GC
+ } else if (gc_is_locked()) {
+ nlr_raise(mp_obj_new_exception_msg(&mp_type_MemoryError,
"memory allocation failed, heap is locked"));
+ #endif
} else {
- nlr_raise(mp_obj_new_exception_msg_varg(& mp_type_MemoryError,
+ nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_MemoryError,
"memory allocation failed, allocating " UINT_FMT " bytes", num_bytes));
}
}