|
|
|
@@ -198,6 +198,20 @@ int SystemStats::getMemorySizeInMegabytes() |
|
|
|
return (int) (mem.ullTotalPhys / (1024 * 1024)) + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
String SystemStats::getEnvironmentVariable (const String& name, const String& defaultValue)
|
|
|
|
{
|
|
|
|
DWORD len = GetEnvironmentVariableW (name.toWideCharPointer(), nullptr, 0);
|
|
|
|
if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
|
|
|
|
return String (defaultValue);
|
|
|
|
|
|
|
|
HeapBlock<WCHAR> buffer (len);
|
|
|
|
len = GetEnvironmentVariableW (name.toWideCharPointer(), buffer, len);
|
|
|
|
|
|
|
|
return String (CharPointer_wchar_t (buffer),
|
|
|
|
CharPointer_wchar_t (buffer + len));
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
uint32 juce_millisecondsSinceStartup() noexcept
|
|
|
|
{
|
|
|
|
|