diff --git a/ide/vs2017/mimalloc-override.vcxproj b/ide/vs2017/mimalloc-override.vcxproj index 98429052..deaa5ead 100644 --- a/ide/vs2017/mimalloc-override.vcxproj +++ b/ide/vs2017/mimalloc-override.vcxproj @@ -212,10 +212,10 @@ - true - true - true - true + false + false + false + false diff --git a/ide/vs2017/mimalloc-test.vcxproj b/ide/vs2017/mimalloc-test.vcxproj index 675d6acb..7976af56 100644 --- a/ide/vs2017/mimalloc-test.vcxproj +++ b/ide/vs2017/mimalloc-test.vcxproj @@ -89,6 +89,7 @@ true true ..\..\include + stdcpp17 Console @@ -101,6 +102,7 @@ true true ..\..\include + stdcpp17 Console @@ -116,6 +118,7 @@ true ..\..\include _MBCS;%(PreprocessorDefinitions);NDEBUG + stdcpp17 true @@ -133,6 +136,7 @@ true ..\..\include _MBCS;%(PreprocessorDefinitions);NDEBUG + stdcpp17 true diff --git a/include/mimalloc.h b/include/mimalloc.h index 8a6de7f1..51d903ad 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -258,10 +258,11 @@ mi_decl_export void mi_free_aligned(void* p, size_t alignment) mi_attr_noexcept; #endif #ifdef __cplusplus -mi_decl_export void* mi_decl_allocator mi_new(std::size_t n) noexcept(false) mi_attr_malloc mi_attr_alloc_size(1); +#include +mi_decl_export void* mi_new(std::size_t n) noexcept(false) mi_attr_malloc mi_attr_alloc_size(1); #if (__cplusplus > 201402L || defined(__cpp_aligned_new)) #include -mi_decl_export void* mi_decl_allocator mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false) mi_attr_malloc mi_attr_alloc_size(1); +mi_decl_export void* mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false) mi_attr_malloc mi_attr_alloc_size(1); #endif #endif diff --git a/src/alloc.c b/src/alloc.c index 10bc9bf6..4f36544a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -106,8 +106,8 @@ void* mi_zalloc(size_t size) mi_attr_noexcept { // multi-threaded free static mi_decl_noinline void _mi_free_block_mt(mi_page_t* page, mi_block_t* block) { - mi_thread_free_t tfree; - mi_thread_free_t tfreex; + mi_thread_free_t tfree = {0}; + mi_thread_free_t tfreex = {0}; bool use_delayed; do { diff --git a/src/page.c b/src/page.c index 319981e5..04464fc5 100644 --- a/src/page.c +++ b/src/page.c @@ -137,8 +137,8 @@ void _mi_page_use_delayed_free(mi_page_t* page, bool enable) { static void mi_page_thread_free_collect(mi_page_t* page) { mi_block_t* head; - mi_thread_free_t tfree; - mi_thread_free_t tfreex; + mi_thread_free_t tfree = {0}; + mi_thread_free_t tfreex = {0}; do { tfreex.value = tfree.value = page->thread_free.value; head = (mi_block_t*)((uintptr_t)tfree.head << MI_TF_PTR_SHIFT);