knight/shared/KeLumpAllocator.h
author David Anderson <dvander@alliedmods.net>
Sun Aug 11 11:30:27 2013 -0700 (2013-08-11)
changeset 3984 d94a0d3bc008
parent 2226 d10b38524be3
permissions -rw-r--r--
Clean up INFO register structure (bug 5844 part 1, r=ds).
     1 #ifndef _INCLUDE_KNIGHT_KE_LUMP_ALLOCATOR_H_
     2 #define _INCLUDE_KNIGHT_KE_LUMP_ALLOCATOR_H_
     3 
     4 #include <KeLinking.h>
     5 #include <KnightAllocator.h>
     6 
     7 namespace Knight
     8 {
     9 	/**
    10 	 * @brief Creates a new lump allocator.
    11 	 *
    12 	 * The lump allocator is intended for cases where there are many allocations 
    13 	 * and none need to be freed.  There is memory wastage, and the lump allocator 
    14 	 * is typically thrown away after use.
    15 	 *
    16 	 * @return			New lump allocator.
    17 	 */
    18 	extern ke_allocator_t * KE_CreateLumpAllocator();
    19 
    20 	/**
    21 	 * @brief Destroys a lump allocator, freeing all of its resources.
    22 	 *
    23 	 * @param lump		Lump allocator.
    24 	 */
    25 	extern void KE_DestroyLumpAllocator(ke_allocator_t *alloc);
    26 
    27 	/**
    28 	 * @brief Clears a lump allocator, so its memory can be re-used from 
    29 	 * the start.
    30 	 *
    31 	 * @param lump		Lump allocator.
    32 	 */
    33 	extern void KE_ResetLumpAllocator(ke_allocator_t *alloc);
    34 }
    35 
    36 #endif //_INCLUDE_KNIGHT_KE_LUMP_ALLOCATOR_H_