modify each page in usertests countfree()

get rid of static for walk() and freewalk()
This commit is contained in:
Robert Morris 2020-08-07 05:32:48 -04:00
parent 050a69610a
commit 8b9b799937
4 changed files with 11 additions and 9 deletions

View file

@ -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));