36 static void *
operator new(
size_t nSize) {
37 return PoolMemAlloc(
static_cast<int>(nSize),
"FixedSizeAlloc", 0);
88 GetStats(
int *pnNodeBytes,
int *pnAllocs,
int *pnMaxAllocs,
int *pnCapacity,
int *pnWasted);
Reference-counted array of script data nodes.
Definition dataarray.h:20
static int sHunkBytes
The bytes AllocHunk() has handed out.
Definition freestore.h:117
void * AllocChunk(int nBytes)
Take a chunk of nodes from the hunks of the pool.
void GetStats(int *pnNodeBytes, int *pnAllocs, int *pnMaxAllocs, int *pnCapacity, int *pnWasted)
Report the use of the store.
void * Alloc()
Hand out a node, growing the store when none is free.
void Free(void *pNode)
Return a node.
FreeStore(int nNodeWords)
Construct an empty store.
void Grow()
Add a chunk of mNodesPerChunk free nodes.
static void Configure(DataArray *pConfig)
Read the sizes of the pool's hunks from the pool block of the mem configuration.
static void * AllocHunk(int nBytes)
Carve bytes from the current hunk of the pool, allocating a new hunk when they do not fit.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
A free node, which starts with the link to the next one.
Definition freestore.h:17
Node * mNext
Definition freestore.h:18