registerNativeByteBacking function
Registers the native allocation that backs bytes.
Called only by the FFI buffer helper after it attaches the allocation's finalizer. Slices created through NativeByteView.slice inherit it.
Implementation
void registerNativeByteBacking(
Uint8List bytes,
ffi.Pointer<ffi.Uint8> pointer,
ffi.Finalizable owner,
) {
final backing = _NativeByteBacking(pointer, owner, bytes.offsetInBytes);
_nativeByteBackings[bytes] = backing;
_nativeBufferBackings[bytes.buffer] = backing;
}