mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 07:29:30 +03:00
Merge branch 'dev' into dev-slice
This commit is contained in:
commit
e87badaa1b
2 changed files with 9 additions and 1 deletions
|
@ -379,7 +379,11 @@ static void _mi_thread_done(mi_heap_t* default_heap);
|
||||||
#endif
|
#endif
|
||||||
static DWORD mi_fls_key = (DWORD)(-1);
|
static DWORD mi_fls_key = (DWORD)(-1);
|
||||||
static void NTAPI mi_fls_done(PVOID value) {
|
static void NTAPI mi_fls_done(PVOID value) {
|
||||||
if (value!=NULL) _mi_thread_done((mi_heap_t*)value);
|
mi_heap_t* heap = (mi_heap_t*)value;
|
||||||
|
if (heap != NULL) {
|
||||||
|
_mi_thread_done(heap);
|
||||||
|
FlsSetValue(mi_fls_key, NULL); // prevent recursion as _mi_thread_done may set it back to the main heap, issue #672
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#elif defined(MI_USE_PTHREADS)
|
#elif defined(MI_USE_PTHREADS)
|
||||||
// use pthread local storage keys to detect thread ending
|
// use pthread local storage keys to detect thread ending
|
||||||
|
|
|
@ -45,6 +45,9 @@ int main() {
|
||||||
char* s = strdup("hello\n");
|
char* s = strdup("hello\n");
|
||||||
free(p2);
|
free(p2);
|
||||||
|
|
||||||
|
mi_heap_t* h = mi_heap_new();
|
||||||
|
mi_heap_set_default(h);
|
||||||
|
|
||||||
p2 = malloc(16);
|
p2 = malloc(16);
|
||||||
p1 = realloc(p1, 32);
|
p1 = realloc(p1, 32);
|
||||||
free(p1);
|
free(p1);
|
||||||
|
@ -61,6 +64,7 @@ int main() {
|
||||||
//mi_stats_print(NULL);
|
//mi_stats_print(NULL);
|
||||||
|
|
||||||
// test_process_info();
|
// test_process_info();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue