mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 20:41:29 -04:00
Make JKRHeap::sCurrentHeap thread local
Needed because we're using true OS threading, so we can't do the normal JSystem heap changing on thread change. Requires encapsulating it (removing the public static field)
This commit is contained in:
@@ -169,9 +169,17 @@ public:
|
||||
static JKRHeap* getRootHeap2() { return sRootHeap2; }
|
||||
|
||||
static JKRHeap* getSystemHeap() { return sSystemHeap; }
|
||||
#if TARGET_PC
|
||||
static JKRHeap* getCurrentHeap();
|
||||
#else
|
||||
static JKRHeap* getCurrentHeap() { return sCurrentHeap; }
|
||||
#endif
|
||||
static void setSystemHeap(JKRHeap* heap) { sSystemHeap = heap; }
|
||||
#if TARGET_PC
|
||||
static void setCurrentHeap(JKRHeap* heap);
|
||||
#else
|
||||
static void setCurrentHeap(JKRHeap* heap) { sCurrentHeap = heap; }
|
||||
#endif
|
||||
|
||||
static void setState_u32ID_(TState* state, u32 id) { state->mId = id; }
|
||||
static void setState_uUsedSize_(TState* state, u32 usedSize) { state->mUsedSize = usedSize; }
|
||||
@@ -195,7 +203,9 @@ public:
|
||||
static JKRHeap* sRootHeap2;
|
||||
|
||||
static JKRHeap* sSystemHeap;
|
||||
#if !TARGET_PC // Hide sCurrentHeap, we need to make it thread local.
|
||||
static JKRHeap* sCurrentHeap;
|
||||
#endif
|
||||
|
||||
static JKRErrorHandler mErrorHandler;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user