summaryrefslogtreecommitdiff
path: root/test/test1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test1.c')
-rw-r--r--test/test1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test1.c b/test/test1.c
new file mode 100644
index 0000000..e37f5a3
--- /dev/null
+++ b/test/test1.c
@@ -0,0 +1,27 @@
+/* test.c
+An example of how to use nedalloc in C
+(C) 2005-2010 Niall Douglas
+*/
+
+#include <stdio.h>
+//#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <nedmalloc.h>
+
+int main(void)
+{
+ printf("\n Test standard malloc");
+// int *p = malloc(2*1024*1024);
+ // if (!p) abort();
+ // printf("\n standard malloc succeed:%p", p);
+ int *n = nedmalloc(2*1024*1024);
+ void *p = nedcalloc(2, 8);
+// if (!n) abort();
+ // printf("\n ned malloc succeed:%p"t n);
+
+ // free(p);
+ nedfree(n);
+ nedfree(p);
+ return 0;
+}