narrow/column/buffer

Arrow buffers — contiguous memory regions backing arrays.

Buffers hold the raw data, validity bitmap, and offsets for Arrow arrays. They are the lowest-level building block of the columnar format.

Types

GBuffer = object
  handle*: ptr GArrowBuffer
Wrapper for an Arrow GArrowBuffer, a contiguous region of bytes.

Procs

proc `=copy`(dest: var GBuffer; src: GBuffer) {....raises: [], tags: [],
    forbids: [].}
proc `=destroy`(x: GBuffer) {....raises: [], tags: [], forbids: [].}
proc `=dup`(x: GBuffer): GBuffer {....raises: [], tags: [], forbids: [].}
proc `=wasMoved`(x: var GBuffer) {....raises: [], tags: [], forbids: [].}
proc dataPointer(buffer: GBuffer): pointer {....raises: [], tags: [], forbids: [].}
Returns a read-only pointer to the buffer's data. The pointer is only valid while the buffer lives. Returns nil if the buffer handle is nil.
proc dataSize(buffer: GBuffer): int64 {....raises: [], tags: [], forbids: [].}
Returns the size of the buffer in bytes. Returns 0 if the buffer handle is nil.
proc newBuffer(data: pointer; size: int64): GBuffer {....raises: [], tags: [],
    forbids: [].}
Creates a buffer that copies the input data.
proc newBuffer(data: pointer; size: int64; copy: bool): GBuffer {....raises: [],
    tags: [], forbids: [].}
Creates a buffer. When copy is true, data is copied. When copy is false, the buffer wraps the existing memory zero-copy (the caller must ensure the memory outlives the buffer).
proc slice(buffer: GBuffer; offset, size: int64): GBuffer {....raises: [],
    tags: [], forbids: [].}
Returns a zero-copy sub-buffer view covering [offset, offset + size) of the original buffer.
proc toPtr(x: GBuffer): ptr GArrowBuffer {.inline, ...raises: [], tags: [],
    forbids: [].}