mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
add extra checks for valid pointers in the pagemap, add max_vabits and debug_commit_full_pagemap options
This commit is contained in:
parent
3a92c35270
commit
c5a2d11193
6 changed files with 33 additions and 19 deletions
|
@ -380,7 +380,9 @@ typedef enum mi_option_e {
|
|||
mi_option_target_segments_per_thread, // experimental (=0)
|
||||
mi_option_reclaim_on_free, // allow to reclaim an abandoned segment on a free (=1)
|
||||
mi_option_full_page_retain, // retain N full pages per size class (=2)
|
||||
mi_option_max_page_candidates, // max candidate pages to consider for allocation (=4)
|
||||
mi_option_max_page_candidates, // max candidate pages to consider for allocation (=4)
|
||||
mi_option_max_vabits, // max virtual address bits to consider in user space (=48)
|
||||
mi_option_debug_commit_full_pagemap, // commit the full pagemap to catch invalid pointer uses (=0)
|
||||
_mi_option_last,
|
||||
// legacy option names
|
||||
mi_option_large_os_pages = mi_option_allow_large_os_pages,
|
||||
|
|
|
@ -459,6 +459,7 @@ static inline mi_page_t* _mi_checked_ptr_page(const void* p) {
|
|||
}
|
||||
|
||||
static inline mi_page_t* _mi_ptr_page(const void* p) {
|
||||
mi_assert_internal(p==NULL || mi_is_in_heap_region(p));
|
||||
#if MI_DEBUG || defined(__APPLE__)
|
||||
return _mi_checked_ptr_page(p);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue