[x2t] Rename MEMORY_LIMIT -> X2T_MEMORY_LIMIT; "0" is no memory limit

This commit is contained in:
Sergey Konovalov
2021-09-24 20:02:27 +03:00
committed by Sergey Konovalov
parent 6148c337d9
commit faeac14054
5 changed files with 7 additions and 5 deletions

View File

@ -47,7 +47,7 @@ namespace NSSystemUtils
static const wchar_t* gc_EnvCreated = L"CREATED";
static const wchar_t* gc_EnvLastModifiedBy = L"LAST_MODIFIED_BY";
static const wchar_t* gc_EnvModified = L"MODIFIED";
static const wchar_t* gc_EnvMemoryLimit = L"MEMORY_LIMIT";
static const wchar_t* gc_EnvMemoryLimit = L"X2T_MEMORY_LIMIT";
static const wchar_t* gc_EnvMemoryLimitDefault = L"4294965097";//4GB
KERNEL_DECL std::wstring GetEnvVariable(const std::wstring& strName);

View File

@ -3,7 +3,7 @@
#include <chrono>
#include <vector>
#include "../../../../DesktopEditor/common/proclimits.h"
#include "../../../../Common/3dParty/misc/proclimits.h"
using namespace std;

View File

@ -1,7 +1,7 @@
#include <iostream>
#include <cstdlib>
#include "../../../../DesktopEditor/common/proclimits.h"
#include "../../../../Common/3dParty/misc/proclimits.h"
using namespace std;

View File

@ -33,7 +33,7 @@
#include "cextracttools.h"
#include "ASCConverters.h"
#include "../../DesktopEditor/common/SystemUtils.h"
#include "../../DesktopEditor/common/proclimits.h"
#include "../../Common/3dParty/misc/proclimits.h"
#include <iostream>
@ -120,7 +120,9 @@ static std::wstring utf8_to_unicode(const char *src)
std::wstring sMemoryLimit = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvMemoryLimit);
if (sMemoryLimit.empty())
sMemoryLimit = NSSystemUtils::gc_EnvMemoryLimitDefault;
limit_memory((size_t)std::stoull(sMemoryLimit));
size_t nMemoryLimit = (size_t)std::stoull(sMemoryLimit);
if (nMemoryLimit > 0)
limit_memory(nMemoryLimit);
std::wstring sArg1, sArg2, sExePath;