Module fress::memory::segment[][src]

Expand description

Store information in segments.

A segment is a contiguous group of memory units. We borrow a segment from the memory pool, and later return it, when the segment is no longer needed. A segment is no longer needed when no construct exists which references it. No references from the stack, nor from other segments.

A segment, concretely, is a line to its anchor element, which sits right before the first content element. The anchor contains information about its segment, such as the number of content units it contains. The anchor allows one or more threads to read information from the segment, sharing the responsibility to return the segment to the memory pool, when no longer needed. The anchor supports this by counting the number of aliases to its segment.

Structs

Constants

Functions