mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
fix compilation with C++, fix overrides in C++ to adhere to the spec (issue #26)
This commit is contained in:
parent
dd59a917ce
commit
c3528203b5
10 changed files with 133 additions and 35 deletions
|
@ -114,7 +114,7 @@ void _mi_page_use_delayed_free(mi_page_t* page, bool enable) {
|
|||
mi_thread_free_t tfreex;
|
||||
|
||||
do {
|
||||
tfreex = tfree = page->thread_free;
|
||||
tfreex.value = tfree.value = page->thread_free.value;
|
||||
tfreex.delayed = (enable ? MI_USE_DELAYED_FREE : MI_NO_DELAYED_FREE);
|
||||
if (mi_unlikely(tfree.delayed == MI_DELAYED_FREEING)) {
|
||||
mi_atomic_yield(); // delay until outstanding MI_DELAYED_FREEING are done.
|
||||
|
@ -140,7 +140,7 @@ static void mi_page_thread_free_collect(mi_page_t* page)
|
|||
mi_thread_free_t tfree;
|
||||
mi_thread_free_t tfreex;
|
||||
do {
|
||||
tfreex = tfree = page->thread_free;
|
||||
tfreex.value = tfree.value = page->thread_free.value;
|
||||
head = (mi_block_t*)((uintptr_t)tfree.head << MI_TF_PTR_SHIFT);
|
||||
tfreex.head = 0;
|
||||
} while (!mi_atomic_compare_exchange((volatile uintptr_t*)&page->thread_free, tfreex.value, tfree.value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue