You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
py: Add #if guard around gc-specific code.
This commit is contained in:
+7
-3
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user