From 632ab24b50fb627036298433f75a6a616838b1b4 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 29 Jan 2011 18:48:50 +0000 Subject: [PATCH] - disable memory vault to see how it affects game performance --- .../shared_lib/sources/platform/common/platform_common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 81844fb0..27985227 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -61,6 +61,8 @@ using namespace Shared::Platform; using namespace Shared::Util; using namespace std; +#define _DISABLE MEMORY_VAULT_CHECKS 1 + namespace Shared { namespace PlatformCommon { namespace Private { @@ -1099,13 +1101,15 @@ string ModeInfo::getString() const{ } void ValueCheckerVault::addItemToVault(const void *ptr,int value) { +#ifndef _DISABLE MEMORY_VAULT_CHECKS Checksum checksum; vaultList[ptr] = checksum.addInt(value); - +#endif // if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] add vault key [%p] value [%s] [%d]\n",__FILE__,__FUNCTION__,__LINE__,ptr,intToStr(checksum.getSum()).c_str(),value); } void ValueCheckerVault::checkItemInVault(const void *ptr,int value) const { +#ifndef _DISABLE MEMORY_VAULT_CHECKS map::const_iterator iterFind = vaultList.find(ptr); if(iterFind == vaultList.end()) { // if(SystemFlags::VERBOSE_MODE_ENABLED) { @@ -1128,6 +1132,7 @@ void ValueCheckerVault::checkItemInVault(const void *ptr,int value) const { // } throw std::runtime_error("memory value has been unexpectedly modified (changed)!"); } +#endif }