diff options
author | Colin Hogben <colin@infinnovation.co.uk> | 2016-10-31 14:52:11 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-03 10:16:31 +1100 |
commit | 828df54bfeaa4a31040fa534dd2961cc9b4ac16e (patch) | |
tree | 3babe8effa72151d3347b457f411c3d7f24b0922 /py/mpconfig.h | |
parent | 94aeba0427cc80e43b59c4155e02e8cb7c327951 (diff) | |
download | micropython-828df54bfeaa4a31040fa534dd2961cc9b4ac16e.tar.gz micropython-828df54bfeaa4a31040fa534dd2961cc9b4ac16e.zip |
py: Change config default so m_malloc0 uses memset if GC not enabled.
With MICROPY_ENABLE_GC set to false the alternate memory manager may not
clear all memory that is allocated, so it must be cleared in m_malloc0.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index fce9976928..fd82b079cc 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -110,10 +110,11 @@ // Be conservative and always clear to zero newly (re)allocated memory in the GC. // This helps eliminate stray pointers that hold on to memory that's no longer // used. It decreases performance due to unnecessary memory clearing. +// A memory manager which always clears memory can set this to 0. // TODO Do analysis to understand why some memory is not properly cleared and // find a more efficient way to clear it. #ifndef MICROPY_GC_CONSERVATIVE_CLEAR -#define MICROPY_GC_CONSERVATIVE_CLEAR (1) +#define MICROPY_GC_CONSERVATIVE_CLEAR (MICROPY_ENABLE_GC) #endif // Support automatic GC when reaching allocation threshold, |