diff --git a/Sources/Plasma/CoreLib/hsMalloc.h b/Sources/Plasma/CoreLib/hsMalloc.h index 8f4436b5..56d53b43 100644 --- a/Sources/Plasma/CoreLib/hsMalloc.h +++ b/Sources/Plasma/CoreLib/hsMalloc.h @@ -62,36 +62,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com extern "C" { #endif -void * MemDup (const void * ptr, unsigned bytes, unsigned flags, const char file[], int line); unsigned MemSize (void * ptr); - -/**************************************************************************** -* -* Manipulation functions -* -***/ - -int MemCmp (const void * buf1, const void * buf2, unsigned bytes); -void MemCopy (void * dest, const void * source, unsigned bytes); -void MemMove (void * dest, const void * source, unsigned bytes); - - -/***************************************************************************** -* -* Debugging functions -* -***/ - -void MemDumpAllocReport (); -void MemDumpUsageReport (); -void MemValidateNow (); -void MemSetValidation (unsigned on); -void MemPushDisableTracking (); -void MemPopDisableTracking (); -void MemSetColor (unsigned short color); - - #ifdef __cplusplus } #endif @@ -109,20 +81,3 @@ void MemSetColor (unsigned short color); #define NEWZERO(t) new(calloc(sizeof(t), 1)) t #endif // __cplusplus - - - -/**************************************************************************** -* -* TypeInfo -* (needed for memory leak reporting) -* -***/ - -#ifdef __cplusplus - -#if !defined(HS_NO_TYPEINFO) -#include -#endif - -#endif // ifdef __cplusplus diff --git a/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp b/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp index c1aefbe3..f78598b6 100644 --- a/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp +++ b/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp @@ -62,10 +62,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # define MEM_DEBUG #endif -const unsigned kMemReallocInPlaceOnly = 1<<0; -const unsigned kMemZero = 1<<1; -const unsigned kMemIgnoreBlock = 1<<2; // don't track this allocation - #ifndef MEM_DEBUG # define _malloc_dbg(s, t, f, l) malloc(s) @@ -467,26 +463,3 @@ unsigned MemSize (void * ptr) { #endif return result; } - - -//=========================================================================== -int MemCmp (const void * buf1, const void * buf2, unsigned bytes) { - return memcmp(buf1, buf2, bytes); -} - -//=========================================================================== -void MemCopy (void * dest, const void * source, unsigned bytes) { - memcpy(dest, source, bytes); -} - -//=========================================================================== -void MemMove (void * dest, const void * source, unsigned bytes) { - memmove(dest, source, bytes); -} - -//=========================================================================== -void * MemDup (const void * ptr, unsigned bytes, unsigned flags, const char file[], int line) { - void * dst = malloc(bytes); - MemCopy(dst, ptr, bytes); - return dst; -} diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index aea4249d..cb6990a1 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -648,55 +648,6 @@ PF_CONSOLE_CMD(Stats, ProfileAllAgeLoads, "", "Turns on Registry.LogReadTimes an #endif // LIMIT_CONSOLE_COMMANDS -////////////////////////////////////////////////////////////////////////////// -//// Memory Commands //////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifndef LIMIT_CONSOLE_COMMANDS - - -PF_CONSOLE_GROUP( Memory ) - -#ifdef HS_FIND_MEM_LEAKS - -PF_CONSOLE_CMD( Memory, DumpAllocReport, // Group name, Function name - "", // Params - "Dump heap allocations to file." ) // Help string -{ - MemDumpAllocReport(); -} - - -PF_CONSOLE_CMD(Memory, - ValidateNow, - "", - "Validate all heap allocations") -{ - MemValidateNow(); -} - - -PF_CONSOLE_CMD(Memory, - SetValidation, - "bool on", - "Validate all heap allocations each time memory is alloced or freed.") -{ - MemSetValidation((bool)params[0]); -} - -PF_CONSOLE_CMD(Memory, - DumpUsage, - "", - "Dump heap usage to file") -{ - MemDumpUsageReport(); -} - - -#endif - -#endif // LIMIT_CONSOLE_COMMANDS - ////////////////////////////////////////////////////////////////////////////// //// Console Group Commands ////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp b/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp index 36cd5084..50361e68 100644 --- a/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp +++ b/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp @@ -181,16 +181,12 @@ void OraConnPool::Initialize_CS () { const unsigned minConns = 0; const unsigned incConns = max(1, maxConns - 1); - // Some memory allocated by createEnvironment is leaked, - // so we disable memory tracking while calling it. - MemPushDisableTracking(); oraEnv.occiEnv = occi::Environment::createEnvironment( "OCCIUTF16", "OCCIUTF16", occi::Environment::THREADED_MUTEXED, nil ); - MemPopDisableTracking(); // Create the connection pool oraEnv.occiPool = oraEnv.occiEnv->createStatelessConnectionPool( diff --git a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp index 0daea115..cceca6f7 100644 --- a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp +++ b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp @@ -115,8 +115,6 @@ const char *plJPEG::GetLastError( void ) plMipmap *plJPEG::IRead( hsStream *inStream ) { - MemPushDisableTracking(); - plMipmap *newMipmap = nil; uint8_t *jpegSourceBuffer = nil; uint32_t jpegSourceSize; @@ -229,7 +227,6 @@ plMipmap *plJPEG::IRead( hsStream *inStream ) // Clean up the JPEG Library jpeg_destroy_decompress( &cinfo ); - MemPopDisableTracking(); // All done! return newMipmap;