mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
The fork is required as Emscripten produces a .wasm file that the upstream web_ffi can't parse correctly to extract exported symbols.
21 lines
551 B
Dart
Executable File
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!');
|
|
}
|
|
}
|