40 #ifdef EMEMORY_STATISTICS
47 pUChar
data() {
return data_; }
49 #ifdef EMEMORY_STATISTICS 50 const ETime &lastAllocated()
const {
return last_; }
51 size_t ccount()
const {
return cnt_; }
65 #ifdef EMEMORY_STATISTICS 76 Node(
Pool &pool) : pool_(pool), next_(nullptr) {}
80 pUChar
data() {
return data_; }
95 Pool(
size_t allocSize=0,
size_t nodeSize=0,
size_t blockCount=0)
110 delete []
reinterpret_cast<pUChar
>(head_);
134 pUChar mem =
new UChar[ns_];
137 for (
size_t i=0; i<bc_; i++)
147 #ifdef EMEMORY_STATISTICS 169 bs_ =
sizeof(
Block) + as_;
170 bs_ += bs_ %
sizeof(pVoid);
173 ns_ =
sizeof(
Node) + bs_ * bc_;
177 bs_ =
sizeof(
Block) + as_;
178 bs_ += bs_ %
sizeof(pVoid);
179 bc_ = (ns_ -
sizeof(
Node)) / bs_;
181 throw EMemory_NodeSizeTooSmall();
195 #endif // #ifndef __EMEMORY_H size_t nodeSize() const
Definition: ememory.h:118
pUChar data()
Definition: ememory.h:47
static ETime Now()
Retrieves the current time.
Definition: etime.cpp:1147
Pool & pool()
Definition: ememory.h:78
Pool & setSize(size_t as, size_t ns, size_t bc=0)
Definition: ememory.h:120
Block * next()
Definition: ememory.h:46
Block & next(Block *nxt)
Definition: ememory.h:61
Node * next()
Definition: ememory.h:79
Provides class for manipulating time of day values.
size_t allocSize() const
Definition: ememory.h:115
Class for manipulating date and time of day values.
Definition: etime.h:199
size_t blockSize() const
Definition: ememory.h:116
Block()
Definition: ememory.h:38
Defines base class for exceptions and declaration helper macros.
DECLARE_ERROR(EMemory_NodeSizeTooSmall)
size_t blockCount() const
Definition: ememory.h:117
Node & next(Node *nxt)
Definition: ememory.h:83
Acquires and holds a lock on the specified mutex.
Definition: esynch.h:133
Pool(size_t allocSize=0, size_t nodeSize=0, size_t blockCount=0)
Definition: ememory.h:95
A private mutex (the mutex data is allocated from either the heap or stack).
Definition: esynch.h:175
Void deallocate(pVoid data)
Definition: ememory.h:153
Node(Pool &pool)
Definition: ememory.h:76
~Pool()
Definition: ememory.h:105
Contains definitions for synchronization objects.
pVoid allocate()
Definition: ememory.h:129
pUChar data()
Definition: ememory.h:80