| 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) |
nothing calls this directly
no outgoing calls
no test coverage detected