#ifndef MI_IN_PAGE_C
#error "this file should be included from 'page.c'"
#endif
#if (MI_MAX_ALIGN_SIZE > 4*MI_INTPTR_SIZE)
#error "define alignment for more than 4x word size for this platform"
#elif (MI_MAX_ALIGN_SIZE > 2*MI_INTPTR_SIZE)
#define MI_ALIGN4W …
#elif (MI_MAX_ALIGN_SIZE > MI_INTPTR_SIZE)
#define MI_ALIGN2W …
#else
#endif
static inline bool mi_page_queue_is_huge(const mi_page_queue_t* pq) { … }
static inline bool mi_page_queue_is_full(const mi_page_queue_t* pq) { … }
static inline bool mi_page_queue_is_special(const mi_page_queue_t* pq) { … }
static inline uint8_t mi_bin(size_t size) { … }
uint8_t _mi_bin(size_t size) { … }
size_t _mi_bin_size(uint8_t bin) { … }
size_t mi_good_size(size_t size) mi_attr_noexcept { … }
#if (MI_DEBUG>1)
static bool mi_page_queue_contains(mi_page_queue_t* queue, const mi_page_t* page) {
mi_assert_internal(page != NULL);
mi_page_t* list = queue->first;
while (list != NULL) {
mi_assert_internal(list->next == NULL || list->next->prev == list);
mi_assert_internal(list->prev == NULL || list->prev->next == list);
if (list == page) break;
list = list->next;
}
return (list == page);
}
#endif
#if (MI_DEBUG>1)
static bool mi_heap_contains_queue(const mi_heap_t* heap, const mi_page_queue_t* pq) {
return (pq >= &heap->pages[0] && pq <= &heap->pages[MI_BIN_FULL]);
}
#endif
static mi_page_queue_t* mi_page_queue_of(const mi_page_t* page) { … }
static mi_page_queue_t* mi_heap_page_queue_of(mi_heap_t* heap, const mi_page_t* page) { … }
static inline void mi_heap_queue_first_update(mi_heap_t* heap, const mi_page_queue_t* pq) { … }
static void mi_page_queue_remove(mi_page_queue_t* queue, mi_page_t* page) { … }
static void mi_page_queue_push(mi_heap_t* heap, mi_page_queue_t* queue, mi_page_t* page) { … }
static void mi_page_queue_enqueue_from(mi_page_queue_t* to, mi_page_queue_t* from, mi_page_t* page) { … }
size_t _mi_page_queue_append(mi_heap_t* heap, mi_page_queue_t* pq, mi_page_queue_t* append) { … }