From 6e1ccf81948c356130a0a9bf02cf0027a47b7361 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 21 Aug 2024 23:38:01 +0300 Subject: ensure our memory is actually used up fully --- tests/malloc/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/malloc/init.c b/tests/malloc/init.c index 5048e82..c5d64d0 100644 --- a/tests/malloc/init.c +++ b/tests/malloc/init.c @@ -9,15 +9,17 @@ START(pid, tid, d0, d1, d2, d3) UNUSED(d2); UNUSED(d3); + const long nallocs = 200000; printf("allocating space for pointers...\n"); - /* 12 MiB / 4K */ - void **allocs = sys_req_mem(200 * sizeof(void *), VM_W | VM_R); + /* 128 MiB / 4K */ + void **allocs = sys_req_mem(nallocs * sizeof(void *), VM_W | VM_R); check(allocs, "initial allocation failed\n"); printf("allocating memory until we run out...\n"); long i = 0; while (1) { + check(i < nallocs, "not enough pointers for malloc test\n"); char *p = sys_req_mem(1, VM_W | VM_R); if (!p) break; -- cgit v1.3