keen/col/buffer
SourceThis is a standard module
and does not need to be explicitly imported.
buffer[t] builtinbuffer-view[t] record (has private fields)to[t] t[](a t buffer)Copies the elements to an immutable array. This is O(a size).
There is no move-to function for buffer, since its pointer and size are immutable and so it can't be made empty.
copy-from[t] void(dest t buffer-view, source t buffer-view)Overwrites
dest with the contents of source. dest and source must be the same size.uninitialized-buffer[t] t buffer(size nat64) unsafeAllocates a buffer full of
gc-safe-value. To use this safely, you need to be careful to never read an element before writing it. For a safer alternative, consider using a for loop to create the buffer.cast-immutable[t] t[](a t buffer) unsafeUnsafe cast to an immutable array. This is O(1). WARN: It's undefined behavior if
a is ever written to again.
buffer. This is O(asize).