mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-12 10:08:44 +08:00
12 lines
395 B
Dart
12 lines
395 B
Dart
import 'web_ffi/web_ffi.dart';
|
|
import 'web_ffi/web_ffi_modules.dart';
|
|
|
|
/// Web implementation of malloc that uses the Memory allocator
|
|
/// Memory.global will be set when the DynamicLibrary is loaded
|
|
Allocator get malloc {
|
|
if (Memory.global == null) {
|
|
throw StateError('Memory.global is not initialized. Make sure spine is initialized before using malloc.');
|
|
}
|
|
return Memory.global!;
|
|
}
|