summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2020-08-07 05:32:48 -0400
committerFrans Kaashoek <[email protected]>2020-08-10 11:19:10 -0400
commit7f35d7a14efe56905d340a0e318f01c7c514320d (patch)
treebc1203ec6dc250f6f9671d9881329e5ab22a069a /user
parent2ae9c8e2722282d9a619c1745d845fb5d862c518 (diff)
downloadxv6-labs-7f35d7a14efe56905d340a0e318f01c7c514320d.tar.gz
xv6-labs-7f35d7a14efe56905d340a0e318f01c7c514320d.tar.bz2
xv6-labs-7f35d7a14efe56905d340a0e318f01c7c514320d.zip
modify each page in usertests countfree()
get rid of static for walk() and freewalk()
Diffstat (limited to 'user')
-rw-r--r--user/usertests.c5
1 files changed, 4 insertions, 1 deletions
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));