mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
remove lock code from atomics (as it is unused)
This commit is contained in:
parent
8e244f6616
commit
a16d95375f
2 changed files with 13 additions and 23 deletions
15
test/main.c
15
test/main.c
|
@ -11,6 +11,17 @@ void test_heap(void* p_out) {
|
|||
//mi_heap_delete(heap); mi_free(p1); mi_free(p2);
|
||||
}
|
||||
|
||||
void test_large() {
|
||||
const size_t N = 1000;
|
||||
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
size_t sz = 1ull << 21;
|
||||
char* a = mi_mallocn_tp(char,sz);
|
||||
for (size_t k = 0; k < sz; k++) { a[k] = 'x'; }
|
||||
mi_free(a);
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
void* p1 = mi_malloc(16);
|
||||
void* p2 = mi_malloc(1000000);
|
||||
|
@ -27,9 +38,9 @@ int main() {
|
|||
p2 = mi_malloc_aligned(160,24);
|
||||
mi_free(p2);
|
||||
mi_free(p1);
|
||||
|
||||
//test_large();
|
||||
|
||||
mi_collect(true);
|
||||
mi_stats_print(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue