3 #include "math/ParaMath.h" 4 #include <boost/pool/object_pool.hpp> 8 #ifndef PARAENGINE_MOBILE 16 extern void *
npl_mem_alloc(
void *ud,
void *ptr,
size_t osize,
size_t nsize);
25 extern void *
npl_mem_dl_alloc(
void *ud,
void *ptr,
size_t osize,
size_t nsize);
35 typedef boost::pool<> pool_type;
59 void*
reallocate(
void *ptr,
size_t osize,
size_t nsize);
62 void deallocate(
void*
const ptr,
const size_t n);
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
static const int s_pool_init_size
this should be log2(s_pool_init_size_bytes)
Definition: NPLStateMemAllocator.h:39
void * allocate(void *ptr, size_t nsize)
allocate a new buffer
Definition: NPLStateMemAllocator.h:53
static const int s_pool_count
how many free lists are there in the pool.
Definition: NPLStateMemAllocator.h:41
memory allocator for NPL runtime state.
Definition: NPLStateMemAllocator.h:32
void * npl_mem_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
this function can be provided as Lua memory allocator using CNPLStateMemAllocator e...
Definition: NPLStateMemAllocator.cpp:51
static const int s_pool_init_size_bytes
the initial smallest fixed sized chunk that the memory pool will create.
Definition: NPLStateMemAllocator.h:37
void deallocate(void *const ptr, const size_t n)
free an old buffer.
Definition: NPLStateMemAllocator.cpp:173
void * reallocate(void *ptr, size_t osize, size_t nsize)
reallocate a buffer, old buffer content are copied to new buffer is necessary
Definition: NPLStateMemAllocator.cpp:87
void * npl_mem_dl_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
this function can be provided as Lua memory allocator using dl_malloc e.g.
Definition: NPLStateMemAllocator.cpp:20