summaryrefslogtreecommitdiff
path: root/py/malloc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-26 22:23:42 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-26 22:23:42 +0100
commit32bef315be8e56ad2d7f69223fe7b9606893b6ab (patch)
treed16ffb11f6cdc38d789077059eecced3bd647c98 /py/malloc.c
parentdbc81df5d4822b3a0fc31ea1c5684b0101e193dd (diff)
py, gc: Only zero out the extra bytes at the end of the heap chunk.
This is a small optimisation to zero out only the additional bytes that the caller did not ask for.
Diffstat (limited to 'py/malloc.c')
-rw-r--r--py/malloc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/py/malloc.c b/py/malloc.c
index 76c3fe6ca..db2578d9a 100644
--- a/py/malloc.c
+++ b/py/malloc.c
@@ -88,13 +88,9 @@ void *m_malloc_with_finaliser(int num_bytes) {
void *m_malloc0(int num_bytes) {
void *ptr = m_malloc(num_bytes);
-#if MICROPY_ENABLE_GC
- // the GC already zeros out all memory
-#else
if (ptr != NULL) {
memset(ptr, 0, num_bytes);
}
-#endif
return ptr;
}