20export template<traceable K, traceable V, traceable F>
22 ptr<F> const & finalizer, std::type_identity_t<
void (*)(F *)
noexcept> runner)
noexcept {
23 return heap::current()->mk_weak(key, value, finalizer, runner);
27export template<traceable T,
class... Args>
28[[nodiscard]] hint_inline
ptr<T> mk(Args &&... args)
noexcept {
33export template<
class T, std::
size_t N>
35 for (std::size_t i = 0; i != N; ++i) target[i].
unsafe_assign(source[i]);
38export template<
class T, std::
size_t N>
39hint_inline
constexpr void assign(std::array<
ptr<T>, N> & target, std::array<
ptr<T>, N>
const & source)
noexcept {
45export template<
class T, std::
size_t N>
47 std::array<
weak_ptr<T>, N>
const & source)
noexcept {
48 for (std::size_t i = 0; i != N; ++i) target[i].
unsafe_assign(source[i]);
51export template<
class T, std::
size_t N>
53 std::array<
weak_ptr<T>, N>
const & source)
noexcept {
static heap * current() noexcept
Read the current thread's dynamically bound heap. Implicit operations require an active heap_scope....
A typed heap offset, with no root registration or ownership.
A four-byte weak heap field; tracing updates its slot without retaining its target....
An external conditional weak-value handle; registration survives dropped handles.Keep this handle out...
void collect_major() noexcept
Collect both generations of the current heap; reset its collection countdown.
void collect() noexcept
Collect the current heap; only registered roots remain meaningful outside it.
constexpr void unsafe_assign(std::array< ptr< T >, N > &target, std::array< ptr< T >, N > const &source) noexcept
Bulk-copy pointer bits without registration; the caller owns the barrier.
weak< V > mk_weak(ptr< K > const &key, ptr< V > const &value, ptr< F > const &finalizer, std::type_identity_t< void(*)(F *) noexcept > runner) noexcept
Register a weak key/value pair and managed finalizer in the current heap. The captureless runner rece...
ptr< T > mk(Args &&... args) noexcept
Allocate a record in the current heap; register a root before collection.
constexpr void assign(std::array< ptr< T >, N > &target, std::array< ptr< T >, N > const &source) noexcept
Copy an array and register young lanes with one old-range check.
void collect_minor(bool promote=false) noexcept
Collect the current heap's young generation; optionally promote survivors.