mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
introduces netbsd's reallocarr overriding.
and couple of tests.
This commit is contained in:
parent
15220c6843
commit
d6a56dd99d
5 changed files with 24 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mimalloc.h>
|
||||
#include <mimalloc-override.h>
|
||||
|
||||
int main() {
|
||||
mi_version(); // ensure mimalloc library is linked
|
||||
|
@ -25,6 +25,12 @@ int main() {
|
|||
//free(p1);
|
||||
//p2 = malloc(32);
|
||||
//mi_free(p2);
|
||||
p1 = malloc(24);
|
||||
p2 = reallocarray(p1, 16, 16);
|
||||
free(p2);
|
||||
p1 = malloc(24);
|
||||
assert(reallocarr(&p1, 16, 16) == 0);
|
||||
free(p1);
|
||||
mi_stats_print(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue