Documentation
¶
Overview ¶
Package arrowx is the only package in ursus that imports arrow-go.
Everything above it speaks ursus types (dtype.DataType, data.Column). Keeping the dependency in one package means the Arrow version can move, or the storage layer can be replaced wholesale, without touching the engine.
Ownership ¶
ursus hides Arrow's Retain/Release refcounting completely. No public ursus type has a Release method. This is safe, and it is safe for a specific, verified reason rather than by hope:
- memory.GoAllocator.Allocate is `make([]byte, size+64)` — plain Go heap.
- memory.GoAllocator.Free is a no-op.
- There is no runtime.SetFinalizer or runtime.AddCleanup anywhere in arrow, arrow/array, or arrow/memory.
So a *memory.Buffer that is never Released keeps its []byte alive exactly as long as the Buffer itself is reachable, and the GC reclaims both together. Refcounting is advisory. TestRiskGateGCReclaims asserts this empirically; if it ever fails, the ownership model — and this comment — must change.
The one place refcounting is real is memory imported across the C Data Interface, where Release calls back into the producer. ursus does not import foreign Arrow memory in v0.1; when it does, Adopt must Retain and attach a runtime.AddCleanup.
Index ¶
Constants ¶
const Alignment = 64
Alignment is the byte alignment every ursus-allocated buffer is guaranteed to have. It matches Arrow's recommended alignment and is the width that lets a SIMD loop start without a scalar prologue.
Note this is a guarantee about buffers ursus allocates, NOT about every buffer ursus may observe: memory.NewBufferBytes over a caller's slice, memory.SliceBuffer, and buffers mmap'd from an IPC file written by another implementation may be aligned to only 8 bytes (which is all the IPC spec mandates). Kernels must treat 64-byte alignment as an optimization hint, never as a precondition.
Variables ¶
This section is empty.
Functions ¶
func Allocator ¶
Allocator returns the allocator for ursus-owned buffers. Every buffer it produces is Alignment-aligned.
Types ¶
This section is empty.