mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
always use MI_HUGE_BLOCK_SIZE for pages in huge segments
This commit is contained in:
parent
4c6814bc68
commit
09f171b4f5
7 changed files with 72 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue