Fix compilation issues

This commit is contained in:
Wojtek Figat
2025-05-25 17:40:00 +02:00
parent 98e59450f1
commit 8f9fa6995e
2 changed files with 14 additions and 1 deletions

View File

@@ -2,6 +2,9 @@
#if PLATFORM_MAC || PLATFORM_IOS
#define PLATFORM_MAC_CACHED PLATFORM_MAC
#define PLATFORM_IOS_CACHED PLATFORM_IOS
#include "ApplePlatform.h"
#include "AppleUtils.h"
#include "Engine/Core/Log.h"
@@ -50,6 +53,10 @@
#include <cxxabi.h>
#endif
// System includes break those defines
#define PLATFORM_MAC PLATFORM_MAC_CACHED
#define PLATFORM_IOS PLATFORM_IOS_CACHED
CPUInfo Cpu;
String UserLocale;
double SecondsPerCycle;
@@ -224,10 +231,16 @@ MemoryStats ApplePlatform::GetMemoryStats()
ProcessMemoryStats ApplePlatform::GetProcessMemoryStats()
{
ProcessMemoryStats result;
#if PLATFORM_IOS
rusage_info_current rusage_payload;
proc_pid_rusage(getpid(), RUSAGE_INFO_CURRENT, (rusage_info_t*)&rusage_payload);
result.UsedPhysicalMemory = rusage_payload.ri_phys_footprint;
#else
mach_task_basic_info_data_t taskInfo;
mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT;
task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&taskInfo, &count);
result.UsedPhysicalMemory = taskInfo.resident_size;
#endif
result.UsedVirtualMemory = result.UsedPhysicalMemory;
return result;
}

View File

@@ -290,7 +290,7 @@ void* Win32Platform::AllocatePages(uint64 numPages, uint64 pageSize)
if (!ptr)
OutOfMemory();
#if COMPILE_WITH_PROFILER
OnMemoryAlloc(ptr, size);
OnMemoryAlloc(ptr, numBytes);
#endif
return ptr;
}