Mario Zechner 934e374724 [flutter] Add web_ffi fork, fix .wasm/.js size
The fork is required as Emscripten produces a .wasm file that the upstream web_ffi can't parse correctly to extract exported symbols.
2022-11-20 22:18:39 +01:00

21 lines
551 B
Dart
Executable File

import 'dart:typed_data';
import 'memory.dart';
import '../ffi/types.dart';
class NullMemory implements Memory {
@override
Pointer<T> allocate<T extends NativeType>(int byteCount, {int? alignment}) {
throw new UnsupportedError(
'Can not use the null memory to allocate space!');
}
@override
ByteBuffer get buffer =>
throw new UnsupportedError('The null memory has no buffer!');
@override
void free(Pointer<NativeType> pointer) {
throw new UnsupportedError('Can not use the null memory to free pointers!');
}
}