Template Function CE::Memory::make_managed_block

Function Documentation

template<typename T, typename Manager>
std::shared_ptr<T> CE::Memory::make_managed_block(Manager &manager, HeapBlock block)

Retain a HeapBlock and its byte release context.

Final release returns the range for reuse even after the Manager facade has been destroyed. Creating the handle requires a live facade; releasing it does not access that facade.

Template Parameters:
  • T – Pointer element type; this helper neither constructs nor destroys T objects.

  • Manager – Facade exposing a retained byte release_context().

Parameters:
  • manager – Live facade borrowed only to capture its release context.

  • block – Valid checked-out byte range, consumed into the final deleter.

Returns:

Shared pointer to the range head, retaining backing owner/context. Retained bytes are not synchronized for user reads/writes. Do not separately return the same range while any returned handle remains. Handle-allocation failure may invoke the prepared final deleter to return the range.