aboutsummaryrefslogtreecommitdiff
path: root/py/malloc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-12-20 16:54:31 +1100
committerDamien George <damien.p.george@gmail.com>2017-12-20 16:55:42 +1100
commit26d4a6fa45526fa7c267cd9228259642701708f6 (patch)
treef8bf2a6ae40d1ba0e8b35c00b24d3ff283552a94 /py/malloc.c
parentd7a52e15398e1746d0b2fd651d11d092fa59c580 (diff)
py/malloc: Remove unneeded code checking m_malloc return value.
m_malloc already checks for a failed allocation so there's no need to check for it in m_malloc0.
Diffstat (limited to 'py/malloc.c')
-rw-r--r--py/malloc.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/py/malloc.c b/py/malloc.c
index 6835ed7c9..ba5c952f3 100644
--- a/py/malloc.c
+++ b/py/malloc.c
@@ -117,9 +117,6 @@ void *m_malloc_with_finaliser(size_t num_bytes) {
void *m_malloc0(size_t num_bytes) {
void *ptr = m_malloc(num_bytes);
- if (ptr == NULL && num_bytes != 0) {
- m_malloc_fail(num_bytes);
- }
// If this config is set then the GC clears all memory, so we don't need to.
#if !MICROPY_GC_CONSERVATIVE_CLEAR
memset(ptr, 0, num_bytes);