add System::free_pages()
This commit is contained in:
parent
ef6abd8ed7
commit
5a8894498b
@ -54,3 +54,8 @@ void * System::alloc_pages(int num)
|
|||||||
-1,
|
-1,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void System::free_pages(void * addr, int num)
|
||||||
|
{
|
||||||
|
(void)munmap(addr, num << System::page_size_log);
|
||||||
|
}
|
||||||
|
@ -6,6 +6,7 @@ class System
|
|||||||
public:
|
public:
|
||||||
static bool init();
|
static bool init();
|
||||||
static void * alloc_pages(int num);
|
static void * alloc_pages(int num);
|
||||||
|
static void free_pages(void * addr, int num);
|
||||||
|
|
||||||
static unsigned long page_size;
|
static unsigned long page_size;
|
||||||
static unsigned int page_size_log;
|
static unsigned int page_size_log;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user