dartmetal 0.2.0 copy "dartmetal: ^0.2.0" to clipboard
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.

    • RAII class for automatic memory allocation and cleanup with finalizers.

    • RAIITyped helper for type-safe allocations of SizedNativeType (Uint8, Uint16, Uint32, Int32, Float, Double).

    • Methods:

      • allocate / allocateTyped
      • clone (deep copy)
      • move (transfer ownership)
      • withScoped / withScopedTyped (automatic cleanup in a scoped block)
    • Access to raw memory via ptr and typed pointer via typedPtr.

Fixed #

  • Resolved sizeOf<T>() compile-time error for generic types by mapping SizedNativeType to 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.

0
likes
140
points
29
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

DartMetal — Low-level system programming for Dart. Touch the metal. Allocate memory. Talk to syscalls. No guardrails.

Homepage
Repository

License

MIT (license)

Dependencies

ffi, path

More

Packages that depend on dartmetal