- disable memory vault to see how it affects game performance
This commit is contained in:
parent
a5a6cf76d6
commit
632ab24b50
|
@ -61,6 +61,8 @@ using namespace Shared::Platform;
|
||||||
using namespace Shared::Util;
|
using namespace Shared::Util;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#define _DISABLE MEMORY_VAULT_CHECKS 1
|
||||||
|
|
||||||
namespace Shared { namespace PlatformCommon {
|
namespace Shared { namespace PlatformCommon {
|
||||||
|
|
||||||
namespace Private {
|
namespace Private {
|
||||||
|
@ -1099,13 +1101,15 @@ string ModeInfo::getString() const{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValueCheckerVault::addItemToVault(const void *ptr,int value) {
|
void ValueCheckerVault::addItemToVault(const void *ptr,int value) {
|
||||||
|
#ifndef _DISABLE MEMORY_VAULT_CHECKS
|
||||||
Checksum checksum;
|
Checksum checksum;
|
||||||
vaultList[ptr] = checksum.addInt(value);
|
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);
|
// 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 {
|
void ValueCheckerVault::checkItemInVault(const void *ptr,int value) const {
|
||||||
|
#ifndef _DISABLE MEMORY_VAULT_CHECKS
|
||||||
map<const void *,int32>::const_iterator iterFind = vaultList.find(ptr);
|
map<const void *,int32>::const_iterator iterFind = vaultList.find(ptr);
|
||||||
if(iterFind == vaultList.end()) {
|
if(iterFind == vaultList.end()) {
|
||||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) {
|
// 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)!");
|
throw std::runtime_error("memory value has been unexpectedly modified (changed)!");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user