summaryrefslogtreecommitdiff
path: root/src/init/tests
diff options
context:
space:
mode:
authordzwdz2022-05-26 20:04:26 +0200
committerdzwdz2022-05-26 20:04:26 +0200
commit0604552310847fd695e9cf62fcddb8e18720fc3b (patch)
treecc58fac2e746d418675e17b55824f57cb3b86644 /src/init/tests
parenta4db5b4706236bd266dcc76b77604bfa8599dc14 (diff)
init: dead simple malloc
Diffstat (limited to 'src/init/tests')
-rw-r--r--src/init/tests/main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c
index 20923b0..29f6c61 100644
--- a/src/init/tests/main.c
+++ b/src/init/tests/main.c
@@ -109,6 +109,26 @@ static void test_memflag(void) {
// TODO the kernel shouldn't even be mapped in userland
}
+static void test_malloc(void) {
+ // not really a test
+ void *p1, *p2, *p3;
+
+ p1 = malloc(420);
+ printf("p1 = 0x%x\n", p1);
+
+ p2 = malloc(1024);
+ printf("p2 = 0x%x\n", p2);
+ free(p2);
+ p2 = malloc(256);
+ printf("p2 = 0x%x\n", p2);
+ free(p2);
+ p2 = malloc(4096);
+ printf("p2 = 0x%x\n", p2);
+ free(p2);
+
+ free(p1);
+}
+
static void stress_fork(void) {
/* run a lot of processes */
for (size_t i = 0; i < 2048; i++) {
@@ -124,5 +144,6 @@ void test_all(void) {
run_forked(test_interrupted_fs);
run_forked(test_orphaned_fs);
run_forked(test_memflag);
- run_forked(stress_fork);
+ run_forked(test_malloc);
+// run_forked(stress_fork);
}