nitroAllocBytes method

int nitroAllocBytes(
  1. Uint8List bytes
)

Copies bytes into a <lib>_nitro_alloc'd buffer — for framed payloads whose ownership transfers to native, such as a @HybridRecord returned from a Dart callback. The C side frees it with its own free.

Implementation

int nitroAllocBytes(Uint8List bytes) {
  final p = nitroAlloc(bytes.length);
  writeBytes(p, bytes);
  return p;
}