diff --git a/src/core/System.cc b/src/core/System.cc index c653b7c..14a7924 100644 --- a/src/core/System.cc +++ b/src/core/System.cc @@ -54,3 +54,8 @@ void * System::alloc_pages(int num) -1, 0); } + +void System::free_pages(void * addr, int num) +{ + (void)munmap(addr, num << System::page_size_log); +} diff --git a/src/core/System.h b/src/core/System.h index a37aeb2..764bac9 100644 --- a/src/core/System.h +++ b/src/core/System.h @@ -6,6 +6,7 @@ class System public: static bool init(); static void * alloc_pages(int num); + static void free_pages(void * addr, int num); static unsigned long page_size; static unsigned int page_size_log;