mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-24 00:53:47 +00:00
initial commit
This change makes the memory manager work again for detecting leaks, the built in one kept coming into de-ref and other bugs so this is the start of a refactor to get it working.
This commit is contained in:
parent
13bf126418
commit
8c812cb448
11 changed files with 258 additions and 1665 deletions
|
|
@ -27,33 +27,22 @@
|
|||
|
||||
namespace Memory
|
||||
{
|
||||
enum EFlag
|
||||
struct MemInfo
|
||||
{
|
||||
FLAG_Debug,
|
||||
FLAG_Global,
|
||||
FLAG_Static
|
||||
void* ptr;
|
||||
dsize_t size;
|
||||
const char* file;
|
||||
U32 line;
|
||||
U32 allocId;
|
||||
bool flagged;
|
||||
|
||||
void* backtracePtrs[16];
|
||||
int backtraceSize;
|
||||
};
|
||||
|
||||
struct Info
|
||||
{
|
||||
U32 mAllocNumber;
|
||||
U32 mAllocSize;
|
||||
const char* mFileName;
|
||||
U32 mLineNumber;
|
||||
bool mIsArray;
|
||||
bool mIsGlobal;
|
||||
bool mIsStatic;
|
||||
};
|
||||
|
||||
void checkPtr( void* ptr );
|
||||
void flagCurrentAllocs( EFlag flag = FLAG_Debug );
|
||||
void ensureAllFreed();
|
||||
void dumpUnflaggedAllocs(const char *file, EFlag flag = FLAG_Debug );
|
||||
S32 countUnflaggedAllocs(const char *file, S32 *outUnflaggedRealloc = NULL, EFlag flag = FLAG_Debug );
|
||||
dsize_t getMemoryUsed();
|
||||
dsize_t getMemoryAllocated();
|
||||
void getMemoryInfo( void* ptr, Info& info );
|
||||
void validate();
|
||||
void init();
|
||||
void shutdown();
|
||||
void checkPtr(void* ptr);
|
||||
}
|
||||
|
||||
#endif // _TORQUE_PLATFORM_PLATFORMMEMORY_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue