From 7f35d7a14efe56905d340a0e318f01c7c514320d Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 7 Aug 2020 05:32:48 -0400 Subject: modify each page in usertests countfree() get rid of static for walk() and freewalk() --- user/usertests.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'user/usertests.c') diff --git a/user/usertests.c b/user/usertests.c index f83a060..aefbc9f 100644 --- a/user/usertests.c +++ b/user/usertests.c @@ -2251,9 +2251,12 @@ countfree() int n = 0; while(1){ - if((uint64)sbrk(4096) == 0xffffffffffffffff){ + uint64 a = (uint64) sbrk(4096); + if(a == 0xffffffffffffffff){ break; } + // modify the memory to make sure it's really allocated. + *(char *)(a - 1) = 1; n += 1; } sbrk(-((uint64)sbrk(0) - sz0)); -- cgit v1.2.3