nativeBackingPointer function
Looks up the native pointer for bytes when they still have provenance.
Implementation
ffi.Pointer<ffi.Uint8>? nativeBackingPointer(Uint8List bytes) {
final backing =
_nativeByteBackings[bytes] ?? _nativeBufferBackings[bytes.buffer];
if (backing == null) return null;
final offset = bytes.offsetInBytes - backing.rootOffset;
return backing.pointer + offset;
}