mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
byte-precise heap block overflow checking with encoded padding
This commit is contained in:
parent
68112a2751
commit
40f1e1e07b
7 changed files with 138 additions and 50 deletions
|
@ -19,7 +19,7 @@ int main() {
|
|||
// double_free1();
|
||||
// double_free2();
|
||||
// corrupt_free();
|
||||
//block_overflow1();
|
||||
// block_overflow1();
|
||||
|
||||
void* p1 = malloc(78);
|
||||
void* p2 = malloc(24);
|
||||
|
@ -44,8 +44,8 @@ int main() {
|
|||
}
|
||||
|
||||
static void block_overflow1() {
|
||||
void* p = mi_malloc(16);
|
||||
memset(p, 0, 17);
|
||||
uint8_t* p = (uint8_t*)mi_malloc(17);
|
||||
p[18] = 0;
|
||||
free(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ terms of the MIT license.
|
|||
// argument defaults
|
||||
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
||||
static int SCALE = 10; // scaling factor
|
||||
static int ITER = 10; // N full iterations destructing and re-creating all threads
|
||||
static int ITER = 50; // N full iterations destructing and re-creating all threads
|
||||
|
||||
// static int THREADS = 8; // more repeatable if THREADS <= #processors
|
||||
// static int SCALE = 100; // scaling factor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue