summaryrefslogtreecommitdiff
path: root/src/kernel/testmalloc.c
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcspace.com>2021-09-21 10:50:33 -0500
committerBrett Weiland <brett_weiland@bpcspace.com>2021-09-21 10:50:33 -0500
commitcf7cd8be60c254b44b444c97dcb238d7cf3afd4c (patch)
treee86fe62827f4dbc5f1b6b74cf7bd89c78e797711 /src/kernel/testmalloc.c
parent907fb823bf8329066b1bcff60ea6c4faa54a3642 (diff)
palloc smp safe (testing required, NOT pfree)
Diffstat (limited to 'src/kernel/testmalloc.c')
-rw-r--r--src/kernel/testmalloc.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/kernel/testmalloc.c b/src/kernel/testmalloc.c
deleted file mode 100644
index 5733c7c..0000000
--- a/src/kernel/testmalloc.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#define CHUNK_SIZE_FROM_INDEX(i) ((1 << ((i) + 5)))
-
-#include <printf.h>
-#include <heap.h>
-#include <libc.h>
-#include <random.h>
-
-//will delete later
-
-void test_malloc(unsigned int cnt) {
- void *testchunks[cnt];
- unsigned int rindex[cnt], testchunk_size, i, x;
-
- bzero(rindex, cnt * sizeof(unsigned int));
- for(x = 0; x < cnt; x++) {
- testchunk_size = (CHUNK_SIZE_FROM_INDEX(randint() % 7) - 24);
- testchunks[x] = malloc(testchunk_size);
- //printf("ALLOCATING CHUNK %p SIZE %i\n", (void *)testchunks[x] - 24, testchunk_size);
- }
- for(x = 0; x < cnt;) {
- i = randint() % cnt;
- if(rindex[i]) continue;
- rindex[i] = x;
- x++;
- }
- for(x = 0; x < cnt; x++) {
- //printf("FREEING CHUNK %p\n", (void *)testchunks[rindex[x]]);
- free(testchunks[rindex[x]]);
- }
- printf("\nmalloc tester:\n");
- printf("THIS NEEDS TO BE EMPTY______________\n");
- debug_heap();
- printf("____________________________________\n");
-
-}