storeMany method

void storeMany(
  1. Memory memory,
  2. int pointer,
  3. List<Object?> values, {
  4. WASIComponentCanonicalRealloc? realloc,
  5. WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8,
})

Stores contiguous values into memory.

Implementation

void storeMany(
  wasm.Memory memory,
  int pointer,
  List<Object?> values, {
  WASIComponentCanonicalRealloc? realloc,
  WASIComponentCanonicalStringEncoding stringEncoding =
      WASIComponentCanonicalStringEncoding.utf8,
}) {
  final bytes = Uint8List.view(memory.buffer);
  _checkMemoryRange(
    bytes,
    pointer,
    values.length * _layout.byteLength,
    _layout.alignment,
  );
  final data = ByteData.view(memory.buffer);
  for (var i = 0; i < values.length; i++) {
    _layout.store(
      memory,
      data,
      pointer + i * _layout.byteLength,
      values[i],
      realloc,
      stringEncoding,
    );
  }
}