mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
merge from dev
This commit is contained in:
commit
2cffc3b851
26 changed files with 467 additions and 208 deletions
|
@ -175,6 +175,7 @@ static void double_free1();
|
|||
static void double_free2();
|
||||
static void corrupt_free();
|
||||
static void block_overflow1();
|
||||
static void invalid_free();
|
||||
|
||||
|
||||
int main() {
|
||||
|
@ -185,6 +186,7 @@ int main() {
|
|||
// double_free2();
|
||||
// corrupt_free();
|
||||
//block_overflow1();
|
||||
invalid_free();
|
||||
|
||||
void* p1 = malloc(78);
|
||||
void* p2 = malloc(24);
|
||||
|
@ -209,6 +211,11 @@ int main() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void invalid_free() {
|
||||
free((void*)0xBADBEEF);
|
||||
realloc((void*)0xBADBEEF,10);
|
||||
}
|
||||
|
||||
static void block_overflow1() {
|
||||
uint8_t* p = (uint8_t*)mi_malloc(17);
|
||||
p[18] = 0;
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
#include <mimalloc.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <mimalloc-new-delete.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue