Core Memory Model

Memory management is a first-class concern. The framework exposes explicit ownership boundaries, arena pooling, and zero-copy views to minimize allocations.

Memory ownership

Arena allocation

The C backend supports arena-backed tensors for high-throughput workloads.

Zero-copy constraints

Zero-copy is available for:

Constraints:

Layout and locality

The underlying layout is row-major.

Garbage collection and destructors

PHP GC works at the object layer. Native memory is freed when:

Best practices

Performance trade-offs

C-level primitives

The tensor memory model is built on:

These primitives ensure data alignment for SIMD and BLAS.