don't panic if a program frees all its memory with sbrk().
if a program sbrk()'s to a non-page-boundary, don't free that page. corresponding usertests.
This commit is contained in:
parent
ca30cac702
commit
4de161f973
3 changed files with 45 additions and 4 deletions
|
|
@ -232,9 +232,7 @@ growproc(int n)
|
|||
return -1;
|
||||
}
|
||||
} else if(n < 0){
|
||||
if((sz = uvmdealloc(p->pagetable, sz, sz + n)) == 0) {
|
||||
return -1;
|
||||
}
|
||||
sz = uvmdealloc(p->pagetable, sz, sz + n);
|
||||
}
|
||||
p->sz = sz;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue