knight/shared/KeLumpAllocator.h
author FlaminSarge <flaminsarge@gmail.com>
Mon Aug 12 01:18:01 2013 +0100 (2013-08-12)
changeset 4001 608bc5be1ef0
parent 2226 d10b38524be3
permissions -rw-r--r--
Add support for more CalcIsAttackCritical helpers. (bug 5576, r=asherkin)
     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_