1 #ifndef _INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_
2 #define _INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_
4 #include <KeStdTypes.h>
11 * @brief Creates a page allocator.
13 * @return New page allocator.
15 extern KePageAllocator *KE_CreatePageAllocator();
18 * @brief Destroys a page allocator, freeing all live pages it owns.
20 * @param Page allocator.
22 extern void KE_DestroyPageAllocator(KePageAllocator *alloc);
25 * @brief Allocates a page of memory.
27 * @param alloc Page allocator.
28 * @return Page of memory.
30 extern void *KE_PageAlloc(KePageAllocator *alloc);
33 * @brief Frees a page of memory.
35 * @param alloc Page allocator.
36 * @param page Page of memory.
38 extern void KE_PageFree(KePageAllocator *alloc, void *page);
41 * @brief Returns the size of a page.
43 * @param alloc Page allocator.
46 extern size_t KE_PageSize(KePageAllocator *alloc);
49 #endif //_INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_