malloc method

int malloc(
  1. int byteCount
)

Dart-owned scratch memory (Emscripten malloc). Pair with free.

Implementation

int malloc(int byteCount) {
  final p = dartI64(call('malloc', [byteCount.toJS]));
  if (p == 0) {
    throw ArgumentError('$libName: WASM malloc($byteCount) failed');
  }
  return p;
}