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
byteCountadopted across isolates without copying. -
recordFfiIsolateTransferCopy(
int byteCount) → void -
Records
byteCountcopied for isolate transferable typed data. -
recordFfiParamCopy(
int byteCount) → void -
Records
byteCountcopied into a parameter scratch or transient buffer. -
recordFfiResultCopy(
int byteCount) → void -
Records a heap copy of
byteCountresult bytes. -
recordFfiResultMalloc(
) → void -
Records one native result
malloc. -
recordFfiResultScratchCopy(
int byteCount) → void -
Records a scratch-to-owned copy of
byteCountresult bytes. -
recordFfiZeroCopyView(
) → void - Records one zero-copy result view.
-
resetFfiCopyBudgetForTest(
) → void -
Clears counters. Tests must call this in
setUp.