From bbcbd3cd1fee630547542c20f60b51d5eb62a001 Mon Sep 17 00:00:00 2001 From: daanx Date: Mon, 9 Dec 2024 19:06:06 -0800 Subject: [PATCH] add cast to avoid errors on clang 7 --- include/mimalloc/internal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mimalloc/internal.h b/include/mimalloc/internal.h index 176c1de8..c6d9ae36 100644 --- a/include/mimalloc/internal.h +++ b/include/mimalloc/internal.h @@ -534,7 +534,7 @@ static inline mi_thread_free_t mi_tf_create(mi_block_t* block, bool owned) { // Thread id of thread that owns this page static inline mi_threadid_t mi_page_thread_id(const mi_page_t* page) { - return mi_atomic_load_relaxed(&page->xthread_id); + return mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_id); } // Thread free access @@ -605,11 +605,11 @@ static inline bool mi_page_is_used_at_frac(const mi_page_t* page, uint16_t n) { static inline bool mi_page_is_abandoned(const mi_page_t* page) { // note: the xheap field of an abandoned heap is set to the subproc (for fast reclaim-on-free) - return (mi_atomic_load_relaxed(&page->xthread_id) <= 1); + return (mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_id) <= 1); } static inline bool mi_page_is_abandoned_mapped(const mi_page_t* page) { - return (mi_atomic_load_relaxed(&page->xthread_id) == 1); + return (mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_id) == 1); } static inline void mi_page_set_abandoned_mapped(mi_page_t* page) { @@ -675,7 +675,7 @@ static inline bool _mi_page_unown(mi_page_t* page) { // Page flags //----------------------------------------------------------- static inline mi_page_flags_t mi_page_flags(const mi_page_t* page) { - return mi_atomic_load_relaxed(&page->xflags); + return mi_atomic_load_relaxed(&((mi_page_t*)page)->xflags); } static inline void mi_page_flags_set(mi_page_t* page, bool set, mi_page_flags_t newflag) {