struct
Lapis::Core::ArenaBuffer(T)
- Lapis::Core::ArenaBuffer(T)
- Struct
- Value
- Object
Overview
Stack-allocated, zero-GC appendable typed buffer view backed by a Slice(T)
carved out of a FrameArena. Ideal for building per-frame vertex, color,
and line batches in sol-vin/diorite or signal argument scratch arrays.
Defined in:
lapis/core/frame_arena.crConstructors
Class Method Summary
Instance Method Summary
-
#<<(value : T) : self
Fluent append operator (
buf << item). - #[](index : Int32) : T
- #[]=(index : Int32, value : T) : T
- #[]?(index : Int32) : T | Nil
- #capacity : Int32
-
#clear : self
Resets the logical element count to 0 while retaining the underlying slice capacity.
- #each(& : T -> ) : Nil
- #empty? : Bool
- #full? : Bool
-
#push(value : T) : Bool
Appends a single element to the arena buffer if space remains.
-
#push_line(a : T, b : T) : Bool
Appends a pair of elements (e.g.
- #raw_slice : Slice(T)
- #remaining : Int32
- #size : Int32
-
#to_slice : Slice(T)
Returns a zero-allocation
Slice(T)view over the written elements (0...@size). - #to_unsafe : Pointer(T)
- #unsafe_fetch(index : Int32) : T
Instance methods inherited from class Object
try?(&)try? try?
Constructor Detail
Class Method Detail
Instance Method Detail
Resets the logical element count to 0 while retaining the underlying slice capacity.
Appends a single element to the arena buffer if space remains. Returns true if written, false if capacity was reached.
Appends a pair of elements (e.g. start/end vertices for a 2D/3D line segment) atomically if at least 2 slots remain.
Returns a zero-allocation Slice(T) view over the written elements (0...@size).