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

@ -27,6 +27,7 @@ we therefore test the API over various inputs. Please add more tests :-)
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#ifdef __cplusplus
#include <vector>
@ -59,6 +60,7 @@ bool mem_is_zero(uint8_t* p, size_t size) {
// ---------------------------------------------------------------------------
int main(void) {
mi_option_disable(mi_option_verbose);
mi_option_set(mi_option_remap_threshold, 100 /* in kib */);
// ---------------------------------------------------
// Malloc
@ -284,6 +286,15 @@ int main(void) {
mi_free(p);
};
CHECK_BODY("reallo-huge") { // By Jason Gibson
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);
};
// ---------------------------------------------------
// Heaps
// ---------------------------------------------------