mirror of
https://bitbucket.org/theswgsource/client-tools-1.2.git
synced 2026-01-16 23:04:40 -05:00
less stupid memory management
This commit is contained in:
@@ -61,8 +61,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,0
|
||||
PRODUCTVERSION 2,0,0,0
|
||||
FILEVERSION 2,0,0,1
|
||||
PRODUCTVERSION 2,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
||||
@@ -49,36 +49,19 @@ static bool SetUserSelectedMemoryManagerTarget()
|
||||
|
||||
static void SetDefaultMemoryManagerTargetSize()
|
||||
{
|
||||
int megabytes = 0;
|
||||
// just use all available up to 2048gb, else ALL available, since we're 99% guranteed to be on a modern machine
|
||||
MEMORYSTATUSEX memoryStatus = { sizeof memoryStatus };
|
||||
megabytes = memoryStatus.ullTotalPhys / 1048576;
|
||||
GlobalMemoryStatusEx(&memoryStatus);
|
||||
int ramMB = (memoryStatus.ullTotalPhys / 1048576);
|
||||
|
||||
// clamp it between 250 and 2048MB
|
||||
if (megabytes >= 2040)
|
||||
{
|
||||
megabytes = 2048;
|
||||
}
|
||||
else if (megabytes >= 1020)
|
||||
{
|
||||
megabytes = 1024;
|
||||
}
|
||||
else if (megabytes <= 760)
|
||||
{
|
||||
megabytes = 768;
|
||||
}
|
||||
else if (megabytes <= 250)
|
||||
{
|
||||
megabytes = 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
megabytes = 768;
|
||||
// without PAE enabled 2048 is the max we can do
|
||||
if (ramMB >= 2048){
|
||||
ramMB = 2048;
|
||||
}
|
||||
|
||||
MemoryManager::setLimit(megabytes, false, false);
|
||||
MemoryManager::setLimit(ramMB, false, false);
|
||||
}
|
||||
|
||||
|
||||
void externalCommandHandler(const char* command)
|
||||
{
|
||||
if (strcmp(command, "npe_continue") == 0)
|
||||
@@ -88,13 +71,6 @@ void externalCommandHandler(const char* command)
|
||||
|
||||
Unicode::String url;
|
||||
|
||||
/*
|
||||
if ((Game::getSubscriptionFeatureBits() & ClientSubscriptionFeature::NPENagForRental) != 0)
|
||||
{
|
||||
url = rentalNagId.localize();
|
||||
}
|
||||
else
|
||||
*/
|
||||
if ((Game::getSubscriptionFeatureBits() & ClientSubscriptionFeature::NPENagForTrial) != 0)
|
||||
{
|
||||
url = trialNagId.localize();
|
||||
|
||||
@@ -537,8 +537,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,0
|
||||
PRODUCTVERSION 2,0,0,0
|
||||
FILEVERSION 2,0,0,1
|
||||
PRODUCTVERSION 2,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
||||
Reference in New Issue
Block a user