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