py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
diff --git a/py/obj.h b/py/obj.h
index f5ce873..fe3c14d 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -306,6 +306,7 @@
extern const struct _mp_obj_bool_t mp_const_true_obj;
extern const struct _mp_obj_tuple_t mp_const_empty_tuple_obj;
extern const struct _mp_obj_ellipsis_t mp_const_ellipsis_obj;
+extern const struct _mp_obj_exception_t mp_const_MemoryError_obj;
extern const struct _mp_obj_exception_t mp_const_GeneratorExit_obj;
// General API for objects