From 218ca90543758a20ac326e444ca0643174ca7384 Mon Sep 17 00:00:00 2001 From: Rebellion Developments Date: Thu, 16 Mar 2000 11:25:00 +0100 Subject: Import Aliens vs Predator - Gold (Build 116) Source code release, imported from: https://www.gamefront.com/games/aliens-vs-predator-3/file/avp-gold-complete-source-code All text files were converted to Unix format. --- 3dc/MEM3DCPP.CPP | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 3dc/MEM3DCPP.CPP (limited to '3dc/MEM3DCPP.CPP') diff --git a/3dc/MEM3DCPP.CPP b/3dc/MEM3DCPP.CPP new file mode 100644 index 0000000..906b589 --- /dev/null +++ b/3dc/MEM3DCPP.CPP @@ -0,0 +1,48 @@ +#include "mem3dc.h" + +#if DBGMALLOC + +#if 1 + +// try and turn C++ new/delete tracking on such that +// we can do a malloc dump when the global objects +// with associated memory allocated is recored, the +// deallocation is recored, and then a malloc dump +// is done + +// note that some global objects wont have their memory +// allocations/deallocations in the constructor/destructor +// tracked through record_malloc/record_free, but since +// global objects are deconstructed in the reverse order +// from construction, the deallocation type in the destructor +// will correspond to the allocation type in the constructor + +int __cpp_new_recording = 0; + +class DebugObject +{ +public: + DebugObject(); + ~DebugObject(); +}; + +DebugObject::DebugObject() +{ + __cpp_new_recording = 1; +} + +DebugObject::~DebugObject() +{ + __cpp_new_recording = 0; + DumpMallocInfo(DUMPTOFILE); +} + +static DebugObject dbo; + +#else + +int __cpp_new_recording = 1; + +#endif + +#endif -- cgit v1.3