MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / _rwDolphinHeapFree

Function _rwDolphinHeapFree

src/SB/Core/gc/iSystem.cpp:371–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369 {
370 if (*(S32*)((S32)__ptr - 4) == 0xDEADBEEF)
371 {
372 free((void*)((S32)__ptr - 32));
373 }
374 else
375 {
376 null_func();
377 if (gEmergencyMemLevel != 0)
378 {
379 xMemPopBase(gEmergencyMemLevel);
380 gEmergencyMemLevel = 0;
381 }
382 }
383 }
384}
385
386// non-matching: sda scheduling
387static void* _rwDolphinHeapAlloc(u32 size)
388{
389 static u32 alloc_num = 0;
390 U32 alloc = (U32)malloc(size + 0x20);
391 if (alloc != NULL)
392 {
393 *(U32*)((U8*)alloc + 0x0) = size;
394 *(U32*)((U8*)alloc + 0x4) = alloc_num;
395 u32 this_alloc = alloc_num;
396 alloc_num++;

Callers

nothing calls this directly

Calls 4

mem_nullFunction · 0.85
null_funcFunction · 0.85
xMemPopBaseFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected