Add hippo.allocate_page()
This commit is contained in:
parent
153a8d43f1
commit
b0e59b3e26
@ -102,4 +102,20 @@ struct hippo
|
||||
free_pages = pp;
|
||||
n_free_pages++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate a physical page.
|
||||
*
|
||||
* @return Page address, or null if none available.
|
||||
*/
|
||||
public static void * allocate_page()
|
||||
{
|
||||
PhysicalPage * pp;
|
||||
if (pp != null)
|
||||
{
|
||||
pp = free_pages;
|
||||
free_pages = free_pages.next;
|
||||
}
|
||||
return cast(void *)pp;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user