struct Lapis::DSL::FrameArenaBuilder

Overview

Declarative configuration builder for Lapis::Core::FrameArena.

Defined in:

lapis/dsl/frame_arena_dsl.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.new(arena : Lapis::Core::FrameArena = ::Lapis::Core::FrameArena.current) #

Instance Method Detail


def buffer(type : T.class, max_elements : Int32) : Lapis::Core::ArenaBuffer(T) forall T #

Allocates a bounded appendable ArenaBuffer(T) from the underlying FrameArena.


def capacity : Int32 #

def push(value : T) : Pointer(T) forall T #

Copies value into the arena and returns a typed Pointer(T).


def reset! : Lapis::Core::FrameArena #

Resets the arena cursor to zero without advancing the frame counter.


def scope(&block : Lapis::Core::FrameArena -> _) #

Executes a nested sub-frame scope that automatically rewinds on block exit.


def slice(type : T.class, count : Int32) : Slice(T) forall T #

Allocates a typed contiguous Slice(T) from the underlying FrameArena.


Resets the arena cursor to zero and advances the frame counter.