memory_manager_chunks.h File Reference

#include <vector>
#include "memory_manager.h"

Include dependency graph for memory_manager_chunks.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

Classes


Detailed Description

Author: Sergey Berezin

Created: Tue Apr 19 14:30:36 2005


License to use, copy, modify, sell and/or distribute this software and its documentation for any purpose is hereby granted without royalty, subject to the terms and conditions defined in the LICENSE file provided with this distribution.


Class MemoryManager: allocates/deallocates memory for objects of a fixed size (the size is a parameter to the constructor). The actual memory is allocated in big chunks, which (at the moment) are never released back. However, the deallocated blocks are later reused.

Typical use of this class is to create MemoryManager* mm = new MemoryManager(sizeof(YourClass)); where YourClass has operators new and delete redefined: void* YourClass::operator new(size_t, MemoryManager* mm) { return mm->newData(); } void YourClass::delete(void*) { } // do not deallocate memory here Then, create objects with obj = new(mm) YourClass(), and destroy them with delete obj; mm->deleteData(obj);

Definition in file memory_manager_chunks.h.


Generated on Tue Jul 3 14:34:33 2007 for CVC3 by  doxygen 1.5.1