knight/shared/KePageAllocator.h
author Dr!fter
Thu Jul 18 21:04:03 2013 -0400 (2013-07-18)
changeset 3956 1ccbc1dfa814
parent 2226 d10b38524be3
child 3980 dc7dfcd855dc
permissions -rw-r--r--
Fix gdc-psyfork when checking linux offset (NPOTB)
     1 #ifndef _INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_
     2 #define _INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_
     3 
     4 #include <KeStdTypes.h>
     5 
     6 namespace Knight
     7 {
     8 	class KePageAllocator;
     9 
    10 	/**
    11 	 * @brief Creates a page allocator.
    12 	 *
    13 	 * @return				New page allocator.
    14 	 */
    15 	extern KePageAllocator *KE_CreatePageAllocator();
    16 
    17 	/**
    18 	 * @brief Destroys a page allocator, freeing all live pages it owns.
    19 	 *
    20 	 * @param				Page allocator.
    21 	 */
    22 	extern void KE_DestroyPageAllocator(KePageAllocator *alloc);
    23 
    24 	/**
    25 	 * @brief Allocates a page of memory.
    26 	 *
    27 	 * @param alloc			Page allocator.
    28 	 * @return				Page of memory.
    29 	 */
    30 	extern void *KE_PageAlloc(KePageAllocator *alloc);
    31 
    32 	/**
    33 	* @brief Frees a page of memory.
    34 	*
    35 	* @param alloc			Page allocator.
    36 	* @param page			Page of memory.
    37 	*/
    38 	extern void KE_PageFree(KePageAllocator *alloc, void *page);
    39 
    40 	/**
    41 	* @brief Returns the size of a page.
    42 	*
    43 	* @param alloc			Page allocator.
    44 	* @return				Page size.
    45 	*/
    46 	extern size_t KE_PageSize(KePageAllocator *alloc);
    47 }
    48 
    49 #endif //_INCLUDE_KNIGHT_KE_PAGE_ALLOCATOR_H_