-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi
Milestone
Description
Presently, the Pointer class contains wrappers for malloc and free.
However, we should consider a more neutral position on memory management. It doesn't makes sense to expose these as primitives in WebAssembly, and we can already implement them in Dart.
We can:
- Remove
Pointer.allocateandPointer.freeand move them topackage:ffi. - Introduce an
AllocatorAPI, e.g.:
class Allocator {
Pointer<Void> allocate(int bytes);
void deallocate(Pointer<Void> memory);
}However, the Allocator API should arguably live in package:ffi anyway. That would facilitate using dependency injection to mock or replace the allocator and implement different allocation strategies.
TimWhiting
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi