mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
This commit is contained in:
parent
afba03145c
commit
5f35933331
4 changed files with 24 additions and 3 deletions
|
@ -19,6 +19,7 @@ static void test_reserved(void);
|
|||
static void negative_stat(void);
|
||||
static void alloc_huge(void);
|
||||
static void test_heap_walk(void);
|
||||
static void test_canary_leak(void);
|
||||
// static void test_large_pages(void);
|
||||
|
||||
|
||||
|
@ -31,7 +32,8 @@ int main() {
|
|||
// double_free2();
|
||||
// corrupt_free();
|
||||
// block_overflow1();
|
||||
block_overflow2();
|
||||
// block_overflow2();
|
||||
test_canary_leak();
|
||||
// test_aslr();
|
||||
// invalid_free();
|
||||
// test_reserved();
|
||||
|
@ -226,6 +228,15 @@ static void test_heap_walk(void) {
|
|||
mi_heap_visit_blocks(heap, true, &test_visit, NULL);
|
||||
}
|
||||
|
||||
static void test_canary_leak(void) {
|
||||
char* p = mi_mallocn_tp(char,23);
|
||||
for(int i = 0; i < 23; i++) {
|
||||
p[i] = '0'+i;
|
||||
}
|
||||
puts(p);
|
||||
free(p);
|
||||
}
|
||||
|
||||
// Experiment with huge OS pages
|
||||
#if 0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue