mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-03-03 19:48:04 +00:00
Decompile a little bit of JKRHeap
This commit is contained in:
parent
1395e3ada2
commit
eaf5de711b
@ -3,13 +3,23 @@
|
||||
|
||||
#include "JSU/JSUList.h"
|
||||
|
||||
class JKRHeap
|
||||
class JKRHeap : public JKRDisposer
|
||||
{
|
||||
public:
|
||||
JKRHeap(void *, u32, JKRHeap *, bool);
|
||||
|
||||
static JKRHeap* findFromRoot(void *);
|
||||
static void* setErrorHandler(void (*)(void *, u32, s32));
|
||||
|
||||
u8 _0[0x5C];
|
||||
u8 _C[0x5C-0xC];
|
||||
JSUPtrList mPtrList; // _5C
|
||||
|
||||
static JKRHeap* sSystemHeap;
|
||||
static JKRHeap* sCurrentHeap;
|
||||
static JKRHeap* sRootHeap;
|
||||
static void* sErrorHandler;
|
||||
};
|
||||
|
||||
void JKRDefaultMemoryErrorRoutine(void *, u32, s32);
|
||||
|
||||
#endif // JKRHEAP_H
|
12
include/JUT/JUTException.h
Normal file
12
include/JUT/JUTException.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef JUTEXCEPTION_H
|
||||
#define JUTEXCEPTION_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class JUTException
|
||||
{
|
||||
public:
|
||||
static void panic_f(const char *, s32, const char *, ...);
|
||||
};
|
||||
|
||||
#endif // JUTEXCEPTION_H
|
19
source/JKR/JKRHeap.cpp
Normal file
19
source/JKR/JKRHeap.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "JKR/JKRHeap.h"
|
||||
#include "JUT/JUTException.h"
|
||||
|
||||
void JKRDefaultMemoryErrorRoutine(void *src, u32 a2, s32 a3)
|
||||
{
|
||||
JUTException::panic_f("JKRHeap.cpp", 0x355, "%s", "abort\n");
|
||||
}
|
||||
|
||||
void* JKRHeap::setErrorHandler(void (*err)(void *, u32, s32))
|
||||
{
|
||||
if (err == 0)
|
||||
{
|
||||
err = (void (*)(void *, u32, s32))(*JKRDefaultMemoryErrorRoutine);
|
||||
}
|
||||
|
||||
void* curErrHandler = JKRHeap::sErrorHandler;
|
||||
JKRHeap::sErrorHandler = err;
|
||||
return curErrHandler;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user