jam 0.0.1
A compacting generational garbage collector for C++26
Loading...
Searching...
No Matches
jam::heap::generation Struct Reference
module jam

One generation's ordered double-mapped arena and collection metadata. More...

Public Member Functions

std::size_t capacity () const noexcept
 Capacity in eight-byte cells, including the reserve.
std::size_t reserved () const noexcept
 Reserved cells for bounded parallel compaction.
std::size_t used () const noexcept
 Allocated prefix in eight-byte cells, including the reserved null cell.
std::size_t start () const noexcept
 Current view's offset in the circular backing, in cells.
std::size_t page_words () const noexcept
 Cells per native OS page (distinct from a rank block).
template<class Self>
auto data (this Self &self) noexcept -> std::conditional_t< std::is_const_v< Self >, word const, word > *
 Borrow cells; dereference an offset as data()[offset].
template<class Self>
decltype(auto) operator[] (this Self &self, offset index) noexcept
 Borrow an allocated cell.
offset field (offset cell, unsigned slot=0) const noexcept
 Read one managed reference field by value.
void set_field (offset cell, offset value, unsigned slot=0) noexcept
 Write a managed reference field's bytes.
std::span< block const > blocks () const noexcept
 Borrow rank descriptors while markers and compaction are quiescent.
offset allocate (std::size_t words, std::size_t alignment_bytes=8) noexcept
 Allocate a positive complete record measured in eight-byte cells.
void clear_marks () noexcept
 Clear marks and alignment requirements; pointer declarations survive.
void mark (offset first, std::size_t words=1, std::size_t alignment_bytes=8) noexcept
 Mark a complete reachable record; concurrent markers are permitted.
bool claim (offset first, std::size_t words=1, std::size_t alignment_bytes=8) noexcept
 Claim traversal by atomically marking the record's first cell.
void pointer (offset where, unsigned slot=0) noexcept
 Declare a managed reference field; may overlap frozen-heap markers.
void compact (std::span< offset > roots={}) noexcept
 Pack marked records, forwarding managed fields and external roots.

Detailed Description

One generation's ordered double-mapped arena and collection metadata.

Definition at line 1219 of file heap.ccm.


The documentation for this struct was generated from the following file: