summaryrefslogtreecommitdiff
path: root/include/mimalloc-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mimalloc-internal.h')
-rw-r--r--include/mimalloc-internal.h25
1 files changed, 5 insertions, 20 deletions
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h
index 6455d57..d886bce 100644
--- a/include/mimalloc-internal.h
+++ b/include/mimalloc-internal.h
@@ -315,39 +315,24 @@ static inline mi_page_queue_t* mi_page_queue(const mi_heap_t* heap, size_t size)
}
+
//-----------------------------------------------------------
// Page flags
//-----------------------------------------------------------
-static inline uintptr_t mi_page_thread_id(const mi_page_t* page) {
- return (page->flags & ~MI_PAGE_FLAGS_MASK);
-}
-
-static inline void mi_page_init_flags(mi_page_t* page, uintptr_t thread_id) {
- mi_assert_internal((thread_id & MI_PAGE_FLAGS_MASK) == 0);
- page->flags = thread_id;
-}
-
-static inline void mi_page_set_thread_id(mi_page_t* page, uintptr_t thread_id) {
- mi_assert_internal((thread_id & MI_PAGE_FLAGS_MASK) == 0);
- page->flags = thread_id | (page->flags & MI_PAGE_FLAGS_MASK);
-}
-
static inline bool mi_page_is_in_full(const mi_page_t* page) {
- return ((page->flags & 0x01) != 0);
+ return page->flags.in_full;
}
static inline void mi_page_set_in_full(mi_page_t* page, bool in_full) {
- if (in_full) page->flags |= 0x01;
- else page->flags &= ~0x01;
+ page->flags.in_full = in_full;
}
static inline bool mi_page_has_aligned(const mi_page_t* page) {
- return ((page->flags & 0x02) != 0);
+ return page->flags.has_aligned;
}
static inline void mi_page_set_has_aligned(mi_page_t* page, bool has_aligned) {
- if (has_aligned) page->flags |= 0x02;
- else page->flags &= ~0x02;
+ page->flags.has_aligned = has_aligned;
}