Files
tww/include/JSystem/JKernel/JKRStdHeap.h
T
LagoLunatic f38b962a58 demo d_file_error OK, fmap/fmap2 work, misc (#1208)
* d_file_error OK, use J2DPane inlines everywhere

* d_menu_fmap demo work

* fmap and fmap2 work

* fix demo regression with ternary fakematch

* inline cleanup, f_pc_profile OK for demo

* fix min/max bss order

* lstair almost for demo
2026-09-17 10:05:55 -04:00

42 lines
1.2 KiB
C++

#ifndef JKRSTDHEAP_H
#define JKRSTDHEAP_H
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/os/OSAlloc.h"
class JKRStdHeap : public JKRHeap {
public:
static JKRStdHeap* create(u32, JKRHeap*, bool);
void do_destroy();
JKRStdHeap(void*, u32, JKRHeap*, bool);
~JKRStdHeap();
void* do_alloc(u32, int);
void do_free(void*);
void do_freeAll();
void do_freeTail();
s32 do_resize(void*, u32);
s32 do_getFreeSize();
void* do_getMaxFreeBlock();
void state_register(JKRHeap::TState*, u32) const;
bool state_compare(const JKRHeap::TState&, const JKRHeap::TState&) const;
#if VERSION > VERSION_DEMO
void do_freeFill();
#endif
u32 getHeapType() { return 'STDH'; }
bool check() { return OSCheckHeap(mHeapHandle) != -1; }
bool dump() {
OSDumpHeap(mHeapHandle);
return OSCheckHeap(mHeapHandle) != -1;
}
s32 do_getSize(void* ptr) { return OSReferentSize(ptr); };
s32 do_getTotalFreeSize() { return getFreeSize(); };
static void* getState_(TState* state) { return getState_buf_(state); }
OSHeapHandle mHeapHandle;
};
inline JKRStdHeap* JKRCreateStdHeap(u32 size, JKRHeap* parent, bool errorFlag) { return JKRStdHeap::create(size, parent, errorFlag); }
#endif /* JKRSTDHEAP_H */