diff options
author | daan <daanl@outlook.com> | 2020-09-03 12:13:09 -0700 |
---|---|---|
committer | daan <daanl@outlook.com> | 2020-09-03 12:13:09 -0700 |
commit | 03071dec0f980dca8943748886454dacec95b28b (patch) | |
tree | c4ff563f33cdb008d39585f292375c47314ada5a /include/mimalloc-internal.h | |
parent | c1a834e8865d4b05f931cea85f8a65c3fc48a0a7 (diff) | |
parent | ff0d98883ed57e242173a023fefe95046617c969 (diff) |
merge from dev-atomic with new atomic interface
Diffstat (limited to 'include/mimalloc-internal.h')
-rw-r--r-- | include/mimalloc-internal.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index d6618d2..a113b12 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -467,21 +467,21 @@ static inline size_t mi_page_usable_block_size(const mi_page_t* page) { // Thread free access static inline mi_block_t* mi_page_thread_free(const mi_page_t* page) { - return (mi_block_t*)(mi_atomic_read_relaxed(&page->xthread_free) & ~3); + return (mi_block_t*)(mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_free) & ~3); } static inline mi_delayed_t mi_page_thread_free_flag(const mi_page_t* page) { - return (mi_delayed_t)(mi_atomic_read_relaxed(&page->xthread_free) & 3); + return (mi_delayed_t)(mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_free) & 3); } // Heap access static inline mi_heap_t* mi_page_heap(const mi_page_t* page) { - return (mi_heap_t*)(mi_atomic_read_relaxed(&page->xheap)); + return (mi_heap_t*)(mi_atomic_load_relaxed(&((mi_page_t*)page)->xheap)); } static inline void mi_page_set_heap(mi_page_t* page, mi_heap_t* heap) { mi_assert_internal(mi_page_thread_free_flag(page) != MI_DELAYED_FREEING); - mi_atomic_write(&page->xheap,(uintptr_t)heap); + mi_atomic_store_release(&page->xheap,(uintptr_t)heap); } // Thread free flag helpers |