mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 14:39:31 +03:00
add huge allocation test (see #544 by @Tiran)
This commit is contained in:
parent
f2bfaa74fe
commit
ccbc8ae0bb
2 changed files with 5 additions and 1 deletions
|
@ -158,7 +158,7 @@ if(MI_DEBUG_UBSAN)
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
message(STATUS "Build with undefined-behavior sanitizer (MI_DEBUG_UBSAN=ON)")
|
message(STATUS "Build with undefined-behavior sanitizer (MI_DEBUG_UBSAN=ON)")
|
||||||
list(APPEND mi_cflags -fsanitize=undefined -g)
|
list(APPEND mi_cflags -fsanitize=undefined -g -fno-sanitize-recover=undefined)
|
||||||
list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=undefined)
|
list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=undefined)
|
||||||
if (NOT MI_USE_CXX)
|
if (NOT MI_USE_CXX)
|
||||||
message(STATUS "(switch to use C++ due to MI_DEBUG_UBSAN)")
|
message(STATUS "(switch to use C++ due to MI_DEBUG_UBSAN)")
|
||||||
|
|
|
@ -72,6 +72,10 @@ int main(void) {
|
||||||
CHECK_BODY("calloc0",{
|
CHECK_BODY("calloc0",{
|
||||||
result = (mi_usable_size(mi_calloc(0,1000)) <= 16);
|
result = (mi_usable_size(mi_calloc(0,1000)) <= 16);
|
||||||
});
|
});
|
||||||
|
CHECK_BODY("malloc-large",{ // see PR #544.
|
||||||
|
void* p = mi_malloc(67108872);
|
||||||
|
mi_free(p);
|
||||||
|
});
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
// Extended
|
// Extended
|
||||||
|
|
Loading…
Add table
Reference in a new issue