boost::capy::recycling_memory_resource::allocate_fast

Allocate without virtual dispatch.

Synopsis

void*
allocate_fast(
    std::size_t bytes,
    std::size_t);

Description

Handles the fast path inline (thread‐local bucket pop) and falls through to the slow path for global pool or heap allocation.

A request larger than the largest size class (2048 bytes) bypasses the pools and goes straight to ::operator new.

The second parameter is the requested alignment, and it is ignored. Every block comes from ::operator new, so blocks carry the implementation's default new alignment and no more.

Exceptions

Name

Thrown on

std::bad_alloc

If the underlying ::operator new fails.

Return Value

A pointer to a block of at least bytes bytes. A pooled block is rounded up to its size class, so it may be larger than requested.

Parameters

Name

Description

bytes

The number of bytes to allocate.

Created with MrDocs