infrastructure/native/bindings/ffi_copy_budget library

Internal copy/allocation counters for FFI hot-path regression tests.

Not exported from the public barrel. Tests reset via resetFfiCopyBudgetForTest and read ffiCopyBudgetSnapshot.

Classes

FfiCopyBudgetSnapshot
Snapshot of FFI copy and allocation counters since the last reset.

Functions

ffiCopyBudgetSnapshot() → FfiCopyBudgetSnapshot
Current counters since the last resetFfiCopyBudgetForTest.
recordFfiIsolateAdopt(int byteCount) → void
Records byteCount adopted across isolates without copying.
recordFfiIsolateTransferCopy(int byteCount) → void
Records byteCount copied for isolate transferable typed data.
recordFfiParamCopy(int byteCount) → void
Records byteCount copied into a parameter scratch or transient buffer.
recordFfiResultCopy(int byteCount) → void
Records a heap copy of byteCount result bytes.
recordFfiResultMalloc() → void
Records one native result malloc.
recordFfiResultScratchCopy(int byteCount) → void
Records a scratch-to-owned copy of byteCount result bytes.
recordFfiZeroCopyView() → void
Records one zero-copy result view.
resetFfiCopyBudgetForTest() → void
Clears counters. Tests must call this in setUp.