summaryrefslogtreecommitdiffstatshomepage
path: root/py/misc.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-04 10:52:59 +0000
committerDamien George <damien.p.george@gmail.com>2014-04-04 10:52:59 +0000
commit6902eeda259a5ed8fe3a5ce5cb19ba9207549d33 (patch)
treed018a0c7a42e03d0705efedbd116ac5de3ad886d /py/misc.h
parent072cf022e007e03a8b850a7197585403868923ab (diff)
downloadmicropython-6902eeda259a5ed8fe3a5ce5cb19ba9207549d33.tar.gz
micropython-6902eeda259a5ed8fe3a5ce5cb19ba9207549d33.zip
py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
Diffstat (limited to 'py/misc.h')
-rw-r--r--py/misc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/misc.h b/py/misc.h
index 35081f18e9..662513eb1a 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -36,6 +36,7 @@ void *m_malloc(int num_bytes);
void *m_malloc0(int num_bytes);
void *m_realloc(void *ptr, int old_num_bytes, int new_num_bytes);
void m_free(void *ptr, int num_bytes);
+void *m_malloc_fail(int num_bytes);
int m_get_total_bytes_allocated(void);
int m_get_current_bytes_allocated(void);