#include <OTC/memory/pool.hh> class OTC_Pool {
public:
static os_typespec* get_os_typespec();
OTC_Pool(size_t theSize);
inline OTC_Pool(size_t theSize, size_t theBlockSize);
~OTC_Pool();
inline size_t elementSize() const;
inline void* allocate();
inline void release(void* theMemory);
};
allocate()
is called. If the maximum block size is not of
sufficient size to hold one block and enough space for internal
requirements, more than the maximum size will be allocated.
OTC_Pool(size_t theSize);
theSize
. If the environment variable
OTCLIB_POOLBLOCKSIZE
is set to an
integer value, it will be used as the
the maximum block size when allocating
new blocks of memory from the operating
system. If the environment variable is not
defined, a default of 2040
bytes will be
used.
inline OTC_Pool(size_t theSize, size_t theBlockSize);
theSize
. The value theBlockSize
, will
be used as the maximum block size when
allocating new blocks of memory from the
operating system.
~OTC_Pool();
inline size_t elementSize() const;
inline void* allocate();
inline void release(void* theMemory);
theMemory
is freed. The element must
have been allocated from this pool. If the
memory was not from this pool, the results
are undefined.