Memoryclass template is used to cause objects to be allocated in a dedicated heap.
template <class type> class Memory
||The type of object with which the dedicated heap is associated.|
Memoryclass template is used as a base class for objects that are to be allocated in a dedicated heap. As an example, if all instances of a class
Fooshould be allocated in a dedicated heap for that class, then
Fooshould inherit from
class Foo : public Memory<Foo>This causes instances of the class
Footo be allocated in the heap associated with the
Memory<Foo>base class whenever the
newoperator is used to create them. The heap itself needs to be defined in the program as follows.
template <> Heap C4::Memory<Foo>::heap("HeapName", poolSize, flags);(See the constructor for the