summaryrefslogtreecommitdiff
path: root/test/malloc
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-07-23 11:23:36 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-07-23 11:23:36 +0000
commit1f020b178664857b0e107778d04fb971a58e6230 (patch)
treec1cd86593b5d354091e0fa3201c5789bec5c53ad /test/malloc
parentf1775381f91f1250b20f1949dfd0364ddb0ee9fc (diff)
- trim any trailing whitespace
Diffstat (limited to 'test/malloc')
-rw-r--r--test/malloc/malloc.c2
-rw-r--r--test/malloc/testmalloc.c16
-rw-r--r--test/malloc/time_malloc.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/test/malloc/malloc.c b/test/malloc/malloc.c
index d63856845..ca7c5f927 100644
--- a/test/malloc/malloc.c
+++ b/test/malloc/malloc.c
@@ -67,7 +67,7 @@ int test2(void)
} else {
free(ptr);
}
-
+
ptr = malloc(100);
ptr = realloc(ptr, 0);
if (ptr) {
diff --git a/test/malloc/testmalloc.c b/test/malloc/testmalloc.c
index caf08a9e1..42707d231 100644
--- a/test/malloc/testmalloc.c
+++ b/test/malloc/testmalloc.c
@@ -27,7 +27,7 @@ int main(void)
free(y);
printf("about to free(0)\n");
free(0);
-
+
x=malloc(13);
printf("x = %p\n", x);
memcpy(x, "Small string", 13);
@@ -37,8 +37,8 @@ int main(void)
memcpy(y, "********** Larger string **********", 36);
printf("0x%p test string2: %s\n", y, (char *)y);
free(y);
-
-
+
+
printf("Allocate 100 nodes 500 bytes each\n");
save = 0;
for (i=0; i<100; i++) {
@@ -50,14 +50,14 @@ int main(void)
lp->next = save;
save = lp;
}
-
+
printf("freeing 100 nodes\n");
while (save) {
lp = save;
save = save->next;
free(lp);
}
-
+
printf("try realloc 100 times \n");
lp = 0;
for (i=1; i<=100; i++) {
@@ -71,7 +71,7 @@ int main(void)
void *unused_ret = realloc(lp, 0);
(void) unused_ret;
}
-
+
printf("Allocate another 100 nodes 600 bytes each\n");
save = 0;
for (i=0; i<100; i++) {
@@ -83,14 +83,14 @@ int main(void)
lp->next = save;
save = lp;
}
-
+
printf("freeing 100 nodes\n");
while (save) {
lp = save;
save = save->next;
free(lp);
}
-
+
printf("alloc test PASSED\n");
exit(0);
diff --git a/test/malloc/time_malloc.c b/test/malloc/time_malloc.c
index 64195107d..0b626654f 100644
--- a/test/malloc/time_malloc.c
+++ b/test/malloc/time_malloc.c
@@ -1,6 +1,6 @@
#include <stdlib.h>
#define REPS (100000)
-int sizes[] = {
+int sizes[] = {
100000, 1024, 42000, 350, 100, 80, 3 ,3,3,3,3,3,3,3,3,3,3,3,3,50,
100000, 1024, 42000, 350, 100, 80, 3 ,3,3,3,3,3,3,3,3,3,3,3,3,50,
100000, 1024, 42000, 350, 100, 80, 3 ,3,3,3,3,3,3,3,3,3,3,3,3,50,