#include "Setup.h"
#include <list>
#include <string>
#include "Types.h"
#include "Locks.h"
Classes | |
class | MemMan |
Singleton (mMan). Do not instantiate. The memory manager. More... | |
class | AutoDelete< T > |
Automatically free a single object when this loses scope. More... | |
class | AutoDeleteArray< T > |
Automatically free an array of objects when this loses scope. More... | |
Defines | |
#define | MEMMAN_TRACING |
#define | new2(obj, type) (dbgN2_PrecheckType(""#obj,""#type), new2_call(new (mMan.InternalAllocBlock(dbgN2_padding*2+sizeof(type))+dbgN2_padding) obj, ""#obj, __FILE__, __LINE__)) |
Allocates a single object. | |
#define | new2_array(obj, count, type) (dbgN2_PrecheckType(""#obj,""#type), new2_array_call<type>(count, ""#obj, __FILE__, __LINE__)) |
Allocates an array of objects. | |
#define | delete2(obj) delete2_call(obj,(void**)&obj,__FILE__,__LINE__) |
Deletes a single object. | |
#define | delete2_array(obj) delete2_array_call(obj,(void**)&obj,__FILE__,__LINE__) |
Deletes an array of objects. |
#define MEMMAN_TRACING |
new2(t,t) - allocates memory for an object of type t new2_array(t,c,t) - allocates memory for an array of t's, of length c.
new2(t(param1,param2,etc),t) - allocates a new t using specific constructor parameters
delete2(mem) - frees memory allocated by new2 delete2_array(mem) - frees an array allocated by new2_array
new and delete should not be mixed with new2 and delete2. it is recommended that you normally never use new and delete. instead, use new2, new2_array, delete2, and delete2_array as follows:
call AddLeakReportCallback to add a callback to be notified of memory leaks when the framework shuts down.
you may not be able to nest new2 statements inside other new2 statements.