Add mi_heap_page_utilization

This commit is contained in:
githubzilla 2024-05-06 07:40:42 +00:00
parent 479edc9b85
commit 89dc53eca9
3 changed files with 42 additions and 1 deletions

View file

@ -285,6 +285,9 @@ mi_decl_export bool mi_manage_os_memory(void* start, size_t size, bool is_commit
mi_decl_export void mi_debug_show_arenas(void) mi_attr_noexcept;
mi_decl_export bool mi_heap_page_is_underutilized(mi_heap_t* heap, void* p, float ratio) mi_attr_noexcept;
mi_decl_export float mi_heap_page_utilization(mi_heap_t* heap, void* p) mi_attr_noexcept;
// Experimental: heaps associated with specific memory arena's
typedef int mi_arena_id_t;
mi_decl_export void* mi_arena_area(mi_arena_id_t arena_id, size_t* size);

View file

@ -85,7 +85,7 @@ terms of the MIT license. A copy of the license can be found in the file
// Encoded free lists allow detection of corrupted free lists
// and can detect buffer overflows, modify after free, and double `free`s.
#if (MI_SECURE>=3 || MI_DEBUG>=1)
#define MI_ENCODE_FREELIST 1
//#define MI_ENCODE_FREELIST 1
#endif