MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Alloc

Method Alloc

Source/Utils/micropather.cpp:378–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376
377
378PathNode* PathNodePool::Alloc()
379{
380 if ( freeMemSentinel.next == &freeMemSentinel ) {
381 MPASSERT( nAvailable == 0 );
382
383 Block* b = NewBlock();
384 b->nextBlock = blocks;
385 blocks = b;
386 MPASSERT( freeMemSentinel.next != &freeMemSentinel );
387 }
388 PathNode* pathNode = freeMemSentinel.next;
389 pathNode->Unlink();
390
391 ++nAllocated;
392 MPASSERT( nAvailable > 0 );
393 --nAvailable;
394 return pathNode;
395}
396
397
398void PathNodePool::AddPathNode( unsigned key, PathNode* root )

Callers

nothing calls this directly

Calls 1

UnlinkMethod · 0.80

Tested by

no test coverage detected