mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

mi_heap_new() Is multithreading unsafe, as expected?

Open 1027663760 opened this issue 1 year ago • 14 comments

windows - x86

heap = mi_heap_new()

Error prone code in multithreading: address = mi_heap_malloc(heap, 666) .................................. mi_free(address)

Code for safe operation without errors: EnterCriticalSection() address = mi_heap_malloc(heap, 666) LeaveCriticalSection() .................................. EnterCriticalSection() mi_free(address) LeaveCriticalSection()

Is this a bug or a design that meets expectations?

1027663760 avatar Apr 06 '23 03:04 1027663760