#include <EStringPool.h>
You may allocate a chunk of memory using the alloc() method; this memory is guaranteed to be reserved until the EStringPool is destroyed or the next time reset() is called.
Chunks are guaranteed to be aligned suitably for any kind of variable (currently hardcoded to 8 bytes).
Public Member Functions | |
EStringPool (unsigned int initial_size=DEFAULT_INITIAL_SIZE) | |
Constructs a pool with the specified initial size. | |
~EStringPool () | |
Destroys the pool, invalidating any allocated buffers. | |
void | reset () |
Invalidates any allocated buffers. | |
char * | alloc (unsigned int size) |
Allocates a chunk of memory. | |
Static Public Attributes | |
const unsigned int | DEFAULT_INITIAL_SIZE = 10240 |
The default initial size of a string pool. |
|
Constructs a pool with the specified initial size. The pool will double in size as necessary to accomodate allocation requests. |
|
Destroys the pool, invalidating any allocated buffers.
|
|
Allocates a chunk of memory. Chunks are guaranteed to be aligned suitably for any kind of variable (currently hardcoded to 8 bytes). The chunk is valid only until the next reset() call or the destruction of the EStringPool object. |
|
Invalidates any allocated buffers.
|
|
The default initial size of a string pool.
|