add linux option for guest memory usage

This commit is contained in:
theofficialgman
2026-08-25 21:11:32 -04:00
parent a0b54b874b
commit 88ab029c74
5 changed files with 315 additions and 41 deletions
+7 -5
View File
@@ -9,10 +9,12 @@
#include <string>
#include <vector>
#if defined(_WIN32)
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif
#include "abi_bridge.h"
@@ -26,7 +28,7 @@
// Global flag to suppress SEH reporting during static constructor execution
bool g_suppressSehReporting = false;
thread_local jmp_buf* g_sehJumpTarget = nullptr;
thread_local MkwJmpBuf* g_sehJumpTarget = nullptr;
thread_local uint32_t g_sehLastExceptionCode = 0;
thread_local uintptr_t g_sehLastExceptionAddress = 0;
thread_local uintptr_t g_sehLastAccessedAddress = 0;
@@ -347,9 +349,9 @@ void SystemBridge::Initialize() {
if (funcAddr == 0 || funcAddr == 0xFFFFFFFF) continue;
if (TranslatedFunctionRegistry::FindByAddressPtr(funcAddr)) {
jmp_buf jumpBuf;
MkwJmpBuf jumpBuf;
g_sehJumpTarget = &jumpBuf;
if (setjmp(jumpBuf) == 0) {
if (MKW_SETJMP(jumpBuf) == 0) {
cpu.gpr[1] = 0x81700000u;
InvokeIndirectCpu(funcAddr, &cpu);
dolCount++;
@@ -387,9 +389,9 @@ void SystemBridge::Initialize() {
if (funcAddr == 0 || funcAddr == 0xFFFFFFFF) continue;
if (TranslatedFunctionRegistry::FindByAddressPtr(funcAddr)) {
jmp_buf jumpBuf;
MkwJmpBuf jumpBuf;
g_sehJumpTarget = &jumpBuf;
if (setjmp(jumpBuf) == 0) {
if (MKW_SETJMP(jumpBuf) == 0) {
cpu.gpr[1] = 0x81700000u;
InvokeIndirectCpu(funcAddr, &cpu);
count++;