Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

10.2 Stack, heap, and spans

Activation records, GC objects, and where span metadata shows up in the compiler story.

Stack, heap, and spans

Not everything is an object. Not everything should be.

Function entry allocates an activation record: parameters, locals, temporaries. Returns pop the frame. This is the fast path—until you capture locals in a closure or spawn and the compiler has opinions.

Fiber stacks are separate from the C#-style “thread pool fantasy”—see Fiber scheduler and stacks.

Objects with identity, arrays, and most shared data live on the heap. The collector traces from roots including fiber handles and channel buffers per runtime contract.

You do not free() in Beskid. You stop leaking references like a professional.

In platform-spec and compiler crates you will see Span / source locations (Spanned<T> in diagnostics)—metadata for where in source, not a Rust Span<T> slice type for users. When reading front-end docs, “span” usually means syntactic range, not stackalloc.

Term in docsMeaning
Source spanStart/end offsets for diagnostics
Stack frameRuntime activation record
Heap objectGC-traced allocation

Arrays are a primitive Beskid type with unified length semantics where the type system allows—see Types and corelib packages for surface API.

Ownership preview