Update sys info

This commit is contained in:
2023-08-27 13:55:23 +02:00
parent 317d5c0e3c
commit d1cef56090
4 changed files with 10 additions and 7 deletions

View File

@@ -99,7 +99,6 @@ namespace openVulkanoCpp
rlimit limit;
if (getrlimit(RLIMIT_AS, &limit) == 0)
{
std::cout << "Maximum memory usage: " << limit.rlim_cur << " bytes" << std::endl;
return limit.rlim_cur;
}
Logger::PERF->error("Failed to query max application memory");
@@ -158,7 +157,7 @@ namespace openVulkanoCpp
struct OsInfo
{
std::string osName, osNameFormatted;
Version version;
OsVersion version;
static std::string TryRead(const std::string line, std::string_view prefix)
{
@@ -170,7 +169,7 @@ namespace openVulkanoCpp
return "";
}
static Version ParseVersionString(char* str)
static OsVersion ParseVersionString(char* str)
{
int ver[3];
int i = 0;
@@ -252,7 +251,7 @@ namespace openVulkanoCpp
return osInfo.osName;
}
Version SystemInfo::GetOsVersion()
OsVersion SystemInfo::GetOsVersion()
{
return osInfo.version;
}

View File

@@ -9,7 +9,7 @@
namespace openVulkanoCpp
{
struct Version
struct OsVersion
{
int major, minor, patch, build;
};
@@ -40,7 +40,7 @@ namespace openVulkanoCpp
static std::string GetDeviceVendorName();
static std::string GetDeviceModelName();
static std::string GetOsName();
static Version GetOsVersion();
static OsVersion GetOsVersion();
static std::string GetOsNameHumanReadable();
static DeviceType GetDeviceType();

View File

@@ -7,6 +7,9 @@
#import "OpenVulkanoAppDelegate.h"
#include "Base/AppEvents.hpp"
#include "Base/Logger.hpp"
#include "Host/SystemInfo.hpp"
#include "Math/ByteSize.hpp"
using namespace openVulkanoCpp;
@@ -43,6 +46,7 @@ using namespace openVulkanoCpp;
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
Logger::MANAGER->warn("Received Memory Warning! RAM Max {}; Available {}; Used: {}", ByteSize(SystemInfo::GetAppRamMax()), ByteSize(SystemInfo::GetAppRamAvailable()), ByteSize(SystemInfo::GetAppRamUsed()));
AppEvents::OnReceivedMemoryWarning();
}

View File

@@ -91,7 +91,7 @@ namespace openVulkanoCpp
return [[[UIDevice currentDevice] systemName] UTF8String];
}
Version SystemInfo::GetOsVersion()
OsVersion SystemInfo::GetOsVersion()
{
NSOperatingSystemVersion osVersion = [NSProcessInfo processInfo].operatingSystemVersion;
return { static_cast<int>(osVersion.majorVersion), static_cast<int>(osVersion.minorVersion), static_cast<int>(osVersion.patchVersion), 0 };