dartmetal 0.2.0
dartmetal: ^0.2.0 copied to clipboard
DartMetal — Low-level system programming for Dart. Touch the metal. Allocate memory. Talk to syscalls. No guardrails.
Changelog #
0.2.0 – 2025-10-13 #
Added #
-
RAII memory management for DartMetal.
-
RAIIclass for automatic memory allocation and cleanup with finalizers. -
RAIITypedhelper for type-safe allocations ofSizedNativeType(Uint8,Uint16,Uint32,Int32,Float,Double). -
Methods:
allocate/allocateTypedclone(deep copy)move(transfer ownership)withScoped/withScopedTyped(automatic cleanup in a scoped block)
-
Access to raw memory via
ptrand typed pointer viatypedPtr.
-
Fixed #
- Resolved
sizeOf<T>()compile-time error for generic types by mappingSizedNativeTypeto concrete sizes internally.
Improved #
- Memory safety: typed RAII allocations prevent misaligned pointer casts.
- Scoped allocations now automatically free memory when exiting the scope.
Notes #
- All RAII allocations are automatically finalized on garbage collection but can be manually freed with
free(). - Deep copies (
clone) and ownership moves (move) fully support typed memory allocations.