mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-28 22:05:40 +08:00
add test for #414
This commit is contained in:
parent
728be93977
commit
752594e764
@ -33,6 +33,7 @@ void padding_shrink(); // issue #209
|
|||||||
void various_tests();
|
void various_tests();
|
||||||
void test_mt_shutdown();
|
void test_mt_shutdown();
|
||||||
void fail_aslr(); // issue #372
|
void fail_aslr(); // issue #372
|
||||||
|
void tsan_numa_test(); // issue #414
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
mi_stats_reset(); // ignore earlier allocations
|
mi_stats_reset(); // ignore earlier allocations
|
||||||
@ -41,6 +42,8 @@ int main() {
|
|||||||
heap_late_free();
|
heap_late_free();
|
||||||
padding_shrink();
|
padding_shrink();
|
||||||
various_tests();
|
various_tests();
|
||||||
|
tsan_numa_test();
|
||||||
|
|
||||||
//test_mt_shutdown();
|
//test_mt_shutdown();
|
||||||
//fail_aslr();
|
//fail_aslr();
|
||||||
mi_stats_print(NULL);
|
mi_stats_print(NULL);
|
||||||
@ -217,3 +220,15 @@ void fail_aslr() {
|
|||||||
printf("pointer p: %p: area up to %p\n", p, (uint8_t*)p + sz);
|
printf("pointer p: %p: area up to %p\n", p, (uint8_t*)p + sz);
|
||||||
*(int*)0x5FFFFFFF000 = 0; // should segfault
|
*(int*)0x5FFFFFFF000 = 0; // should segfault
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// issues #414
|
||||||
|
void dummy_worker() {
|
||||||
|
void* p = mi_malloc(0);
|
||||||
|
mi_free(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tsan_numa_test() {
|
||||||
|
auto t1 = std::thread(dummy_worker);
|
||||||
|
dummy_worker();
|
||||||
|
t1.join();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user