MCPcopy Create free account
hub / github.com/doldecomp/mkdd / allocFromTail

Method allocFromTail

libs/JSystem/JKernel/JKRAramHeap.cpp:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75JKRAramBlock *JKRAramHeap::allocFromTail(u32 size)
76{
77 u32 alignedSize = ALIGN_NEXT(size, 0x20);
78 JKRAramBlock *tailBlock = nullptr;
79
80 for (JSUListIterator<JKRAramBlock> iterator = sAramList.getLast(); iterator != sAramList.getEnd(); --iterator)
81 {
82 JKRAramBlock *block = iterator.getObject();
83 if (block->mFreeSize >= alignedSize)
84 {
85 tailBlock = block;
86 break;
87 }
88 }
89
90 if (tailBlock)
91 {
92 return tailBlock->allocTail(alignedSize, mGroupID, this);
93 }
94
95 return nullptr;
96}
97
98/*u32 JKRAramHeap::getFreeSize(void)
99{

Callers

nothing calls this directly

Calls 4

getLastMethod · 0.45
getEndMethod · 0.45
getObjectMethod · 0.45
allocTailMethod · 0.45

Tested by

no test coverage detected