MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / freeSlot

Function freeSlot

TheForceEngine/TFE_Memory/memoryRegion.cpp:653–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651 }
652
653 void freeSlot(RegionAllocHeader* alloc, RegionAllocHeader* next, MemoryBlock* block)
654 {
655 block->sizeFree += alloc->size;
656
657 assert(alloc->free == 0);
658 if (next && next->free) // Then try merging the current and next.
659 {
660 assert(next->free == 1);
661 // Remove the next block from the freelist.
662 removeHeaderFromFreelist(block, next);
663
664 // Merge
665 alloc->size += next->size;
666 block->count--;
667 }
668 // Then add the new item to the free list.
669 insertBlockIntoFreelist(block, alloc);
670 }
671
672 u64 alloc_align(u64 baseSize)
673 {

Callers 1

region_freeFunction · 0.85

Calls 2

removeHeaderFromFreelistFunction · 0.85
insertBlockIntoFreelistFunction · 0.85

Tested by

no test coverage detected