BloombergLP::bslma::TestAllocator::deallocate

Return the memory block at the specified address back to this allocator. If address is 0, this function has no effect (other than to record relevant statistics). Otherwise, if the memory at address is consistent with being allocated from this test allocator, decrement the number of currently allocated blocks, and decrease the number of currently allocated bytes by the size (in bytes) originally requested for the block. Although technically undefined behavior, if the memory can be determined not to have been allocated from this test allocator, increment the number of mismatches, and -- unless in quiet mode -- immediately report the details of the mismatch to stdout (e.g., as an std::hex memory dump) and abort.

Synopses

Declared in <bslma_testallocator.h>

Return the memory block at the specified address back to this allocator. If address is 0, this function has no effect (other than to record relevant statistics). Otherwise, if the memory at address is consistent with being allocated from this test allocator, decrement the number of currently allocated blocks, and decrease the number of currently allocated bytes by the size (in bytes) originally requested for the block. Although technically undefined behavior, if the memory can be determined not to have been allocated from this test allocator, increment the number of mismatches, and -- unless in quiet mode -- immediately report the details of the mismatch to stdout (e.g., as an std::hex memory dump) and abort.

virtual
void
deallocate(void* address) override;
» more...
void
deallocate(
    void* __p,
    size_t __bytes,
    size_t __alignment = _S_max_align);
» more...