API reference

Allocation and arenas

GooseArrays.DataStack — Type
DataStack(capacity::Integer; max_scopes=64)

Reserve capacity bytes using anonymous mmap. Allocations never move or grow the mapping. Metadata and scope slots are allocated once at construction. An arena belongs to the creating Julia Task. Call close for deterministic release; a finalizer is only a fallback. Supported backends: macOS/Linux/FreeBSD.

source
GooseArrays.with_scope — Function
with_scope(f, stack)

Call f(stack) and rewind to the entry cursor in finally, including on error. Arrays created in this scope become invalid. Arrays in enclosing scopes survive. Scope slots are reused without allocation; nesting is bounded by max_scopes. Returning an array is allowed, but accessing it after this scope throws.

source
GooseArrays.alloc! — Function
alloc!(stack, T, dims...)
alloc!(stack, T, dims::NTuple)

Allocate uninitialized elements by advancing the arena cursor. A failed request does not change the cursor. No data storage is allocated on the Julia GC heap. Descriptor allocation depends on compiler escape analysis and calling context.

source

Array types

GooseArrays.GooseArray — Type
GooseArray{T}(stack, undef, dims...)
GooseArray(stack, source::AbstractArray)

Contiguous column-major fixed-size array backed by stack. T must be a positive-size isbits type. Only element type T and rank N are type parameters; dimension lengths and scope generations are runtime values. The immutable descriptor retains its arena for GC safety and checks scope validity on access. It is deliberately not an isbits type. Escaping/boxing a descriptor can allocate.

source

GooseVector, GooseMatrix, StaticGooseVector, and StaticGooseMatrix are convenient aliases for one- and two-dimensional arrays. AbstractGooseArray is the common parent type.

Errors and introspection

bytesused(s) returns the number of arena bytes in use, capacity(s) the reserved capacity, and available(s) the remaining space. close(s) unmaps the arena and invalidates its array descriptors.

Standard Base and LinearAlgebra methods are covered in the Getting started and Compatibility pages.