diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-21 23:38:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-21 23:38:01 +0300 |
| commit | 6e1ccf81948c356130a0a9bf02cf0027a47b7361 (patch) | |
| tree | a2d3ef7d2e1404b051ecfe710e683f6a100d43b9 | |
| parent | 97ffab0a8472981b927d0f4e81bb72f6ecd69b86 (diff) | |
| download | kmi-6e1ccf81948c356130a0a9bf02cf0027a47b7361.tar.gz kmi-6e1ccf81948c356130a0a9bf02cf0027a47b7361.zip | |
ensure our memory is actually used up fully
| -rw-r--r-- | tests/malloc/init.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |
