mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
Merge branch 'dev3' into dev3-bin
This commit is contained in:
commit
667df6e0d6
3 changed files with 34 additions and 9 deletions
|
@ -712,15 +712,32 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mimalloc.pc"
|
||||||
if (MI_BUILD_TESTS)
|
if (MI_BUILD_TESTS)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
foreach(TEST_NAME api api-fill stress)
|
# static link tests
|
||||||
add_executable(mimalloc-test-${TEST_NAME} test/test-${TEST_NAME}.c)
|
if(MI_BUILD_STATIC)
|
||||||
target_compile_definitions(mimalloc-test-${TEST_NAME} PRIVATE ${mi_defines})
|
foreach(TEST_NAME api api-fill stress)
|
||||||
target_compile_options(mimalloc-test-${TEST_NAME} PRIVATE ${mi_cflags})
|
add_executable(mimalloc-test-${TEST_NAME} test/test-${TEST_NAME}.c)
|
||||||
target_include_directories(mimalloc-test-${TEST_NAME} PRIVATE include)
|
target_compile_definitions(mimalloc-test-${TEST_NAME} PRIVATE ${mi_defines})
|
||||||
target_link_libraries(mimalloc-test-${TEST_NAME} PRIVATE mimalloc ${mi_libraries})
|
target_compile_options(mimalloc-test-${TEST_NAME} PRIVATE ${mi_cflags})
|
||||||
|
target_include_directories(mimalloc-test-${TEST_NAME} PRIVATE include)
|
||||||
|
target_link_libraries(mimalloc-test-${TEST_NAME} PRIVATE mimalloc-static ${mi_libraries})
|
||||||
|
|
||||||
add_test(NAME test-${TEST_NAME} COMMAND mimalloc-test-${TEST_NAME})
|
add_test(NAME test-${TEST_NAME} COMMAND mimalloc-test-${TEST_NAME})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# dynamic override test
|
||||||
|
if(MI_BUILD_SHARED AND NOT WIN32)
|
||||||
|
add_executable(mimalloc-test-stress-dynamic test/test-stress.c)
|
||||||
|
target_compile_definitions(mimalloc-test-stress-dynamic PRIVATE ${mi_defines} "USE_STD_MALLOC=1")
|
||||||
|
target_compile_options(mimalloc-test-stress-dynamic PRIVATE ${mi_cflags})
|
||||||
|
target_include_directories(mimalloc-test-stress-dynamic PRIVATE include)
|
||||||
|
if(APPLE)
|
||||||
|
set(LD_PRELOAD "DYLD_INSERT_LIBRARIES")
|
||||||
|
else()
|
||||||
|
set(LD_PRELOAD "LD_PRELOAD")
|
||||||
|
endif()
|
||||||
|
add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_SHOW_STATS=1 ${LD_PRELOAD}=$<TARGET_FILE:mimalloc> $<TARGET_FILE:mimalloc-test-stress-dynamic>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -89,6 +89,11 @@ jobs:
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
BuildType: release-clang
|
BuildType: release-clang
|
||||||
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
|
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
|
||||||
|
Release SIMD Clang:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
BuildType: release-simd-clang
|
||||||
|
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_OPT_SIMD=ON
|
||||||
Secure Clang:
|
Secure Clang:
|
||||||
CC: clang
|
CC: clang
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
|
@ -148,6 +153,9 @@ jobs:
|
||||||
Release:
|
Release:
|
||||||
BuildType: release
|
BuildType: release
|
||||||
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
|
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
|
||||||
|
Release SIMD:
|
||||||
|
BuildType: release-simd
|
||||||
|
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_OPT_SIMD=ON
|
||||||
Secure:
|
Secure:
|
||||||
BuildType: secure
|
BuildType: secure
|
||||||
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
|
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
|
||||||
|
|
|
@ -354,8 +354,8 @@ int main(int argc, char** argv) {
|
||||||
mi_debug_show_arenas();
|
mi_debug_show_arenas();
|
||||||
mi_collect(true);
|
mi_collect(true);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
mi_stats_print(NULL);
|
mi_stats_print(NULL);
|
||||||
|
#endif
|
||||||
//bench_end_program();
|
//bench_end_program();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue