Refactor: abstract new page allocation to one general function and make helper functions static
This commit is contained in:
@@ -146,9 +146,9 @@ page_fault (struct intr_frame *f)
|
||||
write = (f->error_code & PF_W) != 0;
|
||||
user = (f->error_code & PF_U) != 0;
|
||||
|
||||
if (user && needs_new_page (fault_addr, f->esp))
|
||||
if (user)
|
||||
{
|
||||
if (grow_stack (fault_addr))
|
||||
if (try_alloc_new_page (fault_addr, f->esp))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user