modify each page in usertests countfree()
get rid of static for walk() and freewalk()
This commit is contained in:
parent
2ae9c8e272
commit
7f35d7a14e
4 changed files with 11 additions and 9 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue