Skip to main content

Module buffer

Module buffer 

Source
Expand description

COW (copy-on-write) buffer – the memory primitive under Tensor. COW (Copy-on-Write) buffer – the fundamental memory primitive under Tensor.

Buffer<T> provides reference-counted storage with lazy deep-copy semantics. Cloning a buffer increments the refcount (O(1)); mutation via Buffer::set or Buffer::make_unique triggers a deep copy only when the buffer is shared (refcount > 1).

§Determinism

Buffer operations are fully deterministic. No randomized hashing, no platform-dependent allocation strategies. The COW mechanism ensures that mutation of shared data always produces a fresh, independent copy.

Structs§

Buffer
A reference-counted buffer with copy-on-write semantics.