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

Function xMemPoolAlloc

src/SB/Core/x/xMemMgr.cpp:445–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445void* xMemPoolAlloc(xMemPool* pool)
446{
447 void* retval = pool->FreeList;
448 U32 next = pool->NextOffset;
449 U32 flags = pool->Flags;
450
451 if (retval == NULL)
452 {
453 xMemPoolAddElements(pool, xMemAlloc(gActiveHeap, pool->NumRealloc * pool->Size, 0),
454 pool->NumRealloc);
455 retval = pool->FreeList;
456 }
457
458 pool->FreeList = *(void**)((U32)retval + next);
459 if (flags & 1)
460 {
461 *(void**)((U32)retval + next) = pool->UsedList;
462 pool->UsedList = retval;
463 }
464
465 return retval;
466}
467
468void xMemPoolFree(xMemPool* pool, void* data)
469{

Callers 1

xAnimPoolAllocFunction · 0.70

Calls 2

xMemPoolAddElementsFunction · 0.70
xMemAllocFunction · 0.70

Tested by

no test coverage detected