always use MI_HUGE_BLOCK_SIZE for pages in huge segments

This commit is contained in:
daanx 2023-05-17 13:27:04 -07:00
parent 4c6814bc68
commit 09f171b4f5
7 changed files with 72 additions and 25 deletions

View file

@ -19,13 +19,15 @@ static void negative_stat(void);
static void alloc_huge(void);
static void test_heap_walk(void);
static void test_remap(bool start_remappable);
static void test_remap2(void);
int main() {
mi_version();
mi_stats_reset();
test_remap(true);
test_remap2();
//test_remap(true);
// detect double frees and heap corruption
// double_free1();
// double_free2();
@ -219,6 +221,14 @@ static void test_heap_walk(void) {
mi_heap_visit_blocks(heap, true, &test_visit, NULL);
}
static void test_remap2(void) {
int* p = (int*)mi_malloc(356);
p = (int*)mi_realloc(p, 583);
memset(p, '\0', 580);
p = (int*)mi_realloc(p, 1500705);
p = (int*)mi_realloc(p, 3000711);
mi_free(p);
}
static void test_remap(bool start_remappable) {
const size_t iterN = 100;