stronger secure mode when defining MI_SECURE=4: checks for double free, corrupted free list, and invalid pointer frees. Performance is impacted but not too much -- more perf testing is needed
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <mimalloc.h>
|
||||
#include <new>
|
||||
|
||||
static void double_free();
|
||||
|
||||
static void* p = malloc(8);
|
||||
|
||||
void free_p() {
|
||||
@@ -24,6 +27,7 @@ public:
|
||||
|
||||
int main() {
|
||||
//mi_stats_reset(); // ignore earlier allocations
|
||||
double_free();
|
||||
atexit(free_p);
|
||||
void* p1 = malloc(78);
|
||||
void* p2 = mi_malloc_aligned(16,24);
|
||||
@@ -66,3 +70,5 @@ public:
|
||||
};
|
||||
|
||||
static Static s = Static();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user