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

Method setCommon_heapSpecified

libs/JSystem/JKernel/JKRThread.cpp:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89BOOL JKRThread::setCommon_heapSpecified(JKRHeap *heap, u32 stackSize, int threadPriority)
90{
91#line 161
92 mHeap = heap;
93 mStackSize = stackSize & ~0x1F;
94 mStackMemory = JKRHeap::alloc(mStackSize, 0x20, mHeap);
95 JUT_ASSERT(mStackMemory);
96
97#line 167
98 mThreadRecord = (OSThread *)JKRHeap::alloc(sizeof(OSThread), 0x20, mHeap);
99 JUT_ASSERT(mThreadRecord);
100 return OSCreateThread(mThreadRecord, &JKRThread::start, this, (void *)((u32)mStackMemory + mStackSize), mStackSize, threadPriority, 1);
101}
102
103void *JKRThread::start(void *thread) { return static_cast<JKRThread *>(thread)->run(); }
104

Callers

nothing calls this directly

Calls 2

allocFunction · 0.85
OSCreateThreadFunction · 0.85

Tested by

no test coverage detected