fix issue #363 and disable assertion for now

This commit is contained in:
Daan Leijen 2021-02-22 15:05:47 -08:00
parent 8f69e7095d
commit 47050371a1
3 changed files with 26 additions and 9 deletions

View file

@ -32,14 +32,17 @@ void heap_late_free(); // issue #204
void padding_shrink(); // issue #209
void various_tests();
void test_mt_shutdown();
void large_alloc(void); // issue #363
int main() {
mi_stats_reset(); // ignore earlier allocations
heap_thread_free_large();
heap_no_delete();
heap_late_free();
padding_shrink();
various_tests();
large_alloc();
//heap_thread_free_large();
//heap_no_delete();
//heap_late_free();
//padding_shrink();
//various_tests();
//test_mt_shutdown();
mi_stats_print(NULL);
return 0;
@ -176,7 +179,7 @@ void heap_thread_free_large_worker() {
void heap_thread_free_large() {
for (int i = 0; i < 100; i++) {
shared_p = mi_malloc_aligned(2*1024*1024 + 1, 8);
shared_p = mi_malloc_aligned(2 * 1024 * 1024 + 1, 8);
auto t1 = std::thread(heap_thread_free_large_worker);
t1.join();
}
@ -207,3 +210,15 @@ void test_mt_shutdown()
std::cout << "done" << std::endl;
}
// issue #363
using namespace std;
void large_alloc(void)
{
char* a = new char[1ull << 25];
thread th([&] {
delete[] a;
});
th.join();
}