MCPcopy Create free account
hub / github.com/NLPOptimize/flash-tokenizer / performAllocation

Method performAllocation

include/robin_hood.h:506–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504 // Called when no memory is available (mHead == 0).
505 // Don't inline this slow path.
506 ROBIN_HOOD(NOINLINE) T* performAllocation() {
507 size_t const numElementsToAlloc = calcNumElementsToAlloc();
508
509 // alloc new memory: [prev |T, T, ... T]
510 size_t const bytes = ALIGNMENT + ALIGNED_SIZE * numElementsToAlloc;
511 ROBIN_HOOD_LOG("std::malloc " << bytes << " = " << ALIGNMENT << " + " << ALIGNED_SIZE
512 << " * " << numElementsToAlloc)
513 add(assertNotNull<std::bad_alloc>(std::malloc(bytes)), bytes);
514 return mHead;
515 }
516
517 // enforce byte alignment of the T's
518#if ROBIN_HOOD(CXX) >= ROBIN_HOOD(CXX14)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected