infrastructure/native/bindings/ffi_buffer_helper library

Classes

StreamBufferFetchResult
Result of a streaming FFI buffer callback (includes has-more flag).

Constants

ffiScratchPoolSlotCount → const int
Reusable FFI scratch slots per isolate.
initialBufferSize → const int
Initial buffer size for FFI buffer allocations (64 KB).
maxBufferSize → const int
Maximum buffer size for FFI buffer allocations (16 MB).
zeroCopyResultThresholdBytes → const int
Minimum successful FFI payload size before returning a zero-copy view.

Properties

isZeroCopyResultBufferAvailable bool
True when the native engine exports odbc_release_buffer (ABI 1.1+).
no setter

Functions

callWithBuffer(BufferCallback fn, {int? maxSize, int? initialSize, bool preferTransient = false, bool? allowZeroCopy}) Uint8List?
Calls a buffer callback function with dynamically sized buffers.
materializeFfiBytes(Pointer<Uint8> buf, int length, {required bool transferOwnership, required bool allowZeroCopy}) Uint8List
Materializes FFI bytes using the same zero-copy policy as callWithBuffer.
preferTransientFfiBufferForParams(Uint8List params) bool
When true, skip the reusable scratch pool so large sync param queries can return zero-copy result views without an extra scratch→owned copy.
resetZeroCopyResultBufferBindingForTest() → void
Clears cached zero-copy bindings (tests only).
streamCallWithBuffer(StreamBufferCallback fn, {int? maxSize, int? initialSize}) StreamBufferFetchResult?
Like callWithBuffer for stream fetch callbacks that also return hasMore.

Typedefs

BufferCallback = int Function(Pointer<Uint8> buf, int bufLen, Pointer<Uint32> outWritten)
Callback function type for FFI buffer operations.
StreamBufferCallback = int Function(Pointer<Uint8> buf, int bufLen, Pointer<Uint32> outWritten, Pointer<Uint8> hasMore)