| 611 | CHECK_AND_INC_MEM_OP_STATS(this, Allocs); |
| 612 | const auto size = sizeEach * numEntries; |
| 613 | auto alignmentValue = alignment.has_value() ? alignment.value() : alignment_; |
| 614 | const auto alignedSize = sizeAlign(size, alignmentValue); |
| 615 | reserve(alignedSize); |
| 616 | void* buffer = allocator_->allocateZeroFilled(alignedSize); |
| 617 | if (FOLLY_UNLIKELY(buffer == nullptr)) { |
| 618 | release(alignedSize); |
| 619 | handleAllocationFailure(fmt::format( |
| 620 | "{} failed with {} entries and {} each from {} {}", |
| 621 | __FUNCTION__, |
| 622 | numEntries, |
| 623 | succinctBytes(sizeEach), |
| 624 | toString(), |
| 625 | allocator_->getAndClearFailureMessage())); |
| 626 | } |
| 627 | RECORD_ALLOC(buffer, size); |
| 628 | return buffer; |
| 629 | } |
| 630 | |
| 631 | void* MemoryPoolImpl::reallocate( |
| 632 | void* p, |
| 633 | int64_t size, |
| 634 | int64_t newSize, |
| 635 | std::optional<uint8_t> alignment) { |
| 636 | CHECK_AND_INC_MEM_OP_STATS(this, Allocs); |
| 637 | auto alignmentValue = alignment.has_value() ? alignment.value() : alignment_; |
| 638 | const auto alignedNewSize = sizeAlign(newSize, alignmentValue); |
nothing calls this directly
no test coverage detected