support zero-initialized memory detection

This commit is contained in:
daan 2019-09-02 13:16:52 -07:00
parent 216d75a222
commit d1bd1644d5
9 changed files with 123 additions and 48 deletions

View file

@ -12,7 +12,7 @@ terms of the MIT license. A copy of the license can be found in the file
// Empty page used to initialize the small free pages array
const mi_page_t _mi_page_empty = {
0, false, false, false, 0, 0,
0, false, false, false, false, 0, 0,
{ 0 },
NULL, // free
#if MI_SECURE
@ -352,7 +352,7 @@ void mi_thread_init(void) mi_attr_noexcept
pthread_setspecific(mi_pthread_key, (void*)(_mi_thread_id()|1)); // set to a dummy value so that `mi_pthread_done` is called
#endif
#if (MI_DEBUG>0) && !defined(NDEBUG) // not in release mode as that leads to crashes on Windows dynamic override
#if (MI_DEBUG>0 && !defined(_WIN32))
_mi_verbose_message("thread init: 0x%zx\n", _mi_thread_id());
#endif
}
@ -367,7 +367,7 @@ void mi_thread_done(void) mi_attr_noexcept {
// abandon the thread local heap
if (_mi_heap_done()) return; // returns true if already ran
#if (MI_DEBUG>0)
#if (MI_DEBUG>0 && !defined(_WIN32))
if (!_mi_is_main_thread()) {
_mi_verbose_message("thread done: 0x%zx\n", _mi_thread_id());
}