summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2021-12-01 22:43:13 +0000
committerDavid Carlier <devnexen@gmail.com>2021-12-01 22:43:13 +0000
commitd6a56dd99d5abe4e1f6af555976ee8dc64e1ec8a (patch)
treefcd7942b6de7becbb4b774fcea7896aa166a1db6 /test
parent15220c684331d1c486550d7a6b1736e0a1773816 (diff)
introduces netbsd's reallocarr overriding.
and couple of tests.
Diffstat (limited to 'test')
-rw-r--r--test/main-override.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/main-override.c b/test/main-override.c
index 1bec117..284fdd2 100644
--- a/test/main-override.c
+++ b/test/main-override.c
@@ -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;
}