From b245c398a36c07575fcbce4f2cd87640aed8a0a9 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 14 Feb 2010 22:37:46 +0000 Subject: keep a few separate thunkmanagers so they don't all share the same register backup area. seems to fix the single-core-paired-single-x64 issue in mario kart wii, please test the other games that were problematic. this is probably not the best way to fix it but it'll do for now. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5062 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thunk.cpp | 2 -- Source/Core/Common/Src/Thunk.h | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'Source/Core/Common') diff --git a/Source/Core/Common/Src/Thunk.cpp b/Source/Core/Common/Src/Thunk.cpp index aad55cb3c4..1792df3e77 100644 --- a/Source/Core/Common/Src/Thunk.cpp +++ b/Source/Core/Common/Src/Thunk.cpp @@ -23,8 +23,6 @@ #include "ABI.h" #include "Thunk.h" -ThunkManager thunks; - #define THUNK_ARENA_SIZE 1024*1024*1 namespace diff --git a/Source/Core/Common/Src/Thunk.h b/Source/Core/Common/Src/Thunk.h index 44cfc0c4cb..ac40babe4c 100644 --- a/Source/Core/Common/Src/Thunk.h +++ b/Source/Core/Common/Src/Thunk.h @@ -43,13 +43,17 @@ class ThunkManager : public Gen::XCodeBlock const u8 *load_regs; public: + ThunkManager() { + Init(); + } + ~ThunkManager() { + Shutdown(); + } + void *ProtectFunction(void *function, int num_params); +private: void Init(); - void Reset(); void Shutdown(); - - void *ProtectFunction(void *function, int num_params); + void Reset(); }; -extern ThunkManager thunks; - #endif // _THUNK_H_ -- cgit v1.2.3