NuMem - safe(r) nogc memory managment

Luna luna at foxgirls.gay
Sat Dec 30 15:17:36 UTC 2023


NuMem 0.5.4 has been released, numem is a new library I am 
developing with contributions from Auburn Sounds/p0nce. It's 
meant to provide safer ways of writing nogc code, which is 
sometimes neccesary when the D garbage collector would be an 
unoptimal choice.

NuMem currently features:

  * C++ style smart pointers (unique_ptr, shared_ptr, weak_ptr)
  * C++ style vector type (with support for moving unique_ptr's 
in!)
  * Alternative for new and destroy; `nogc_new` and `nogc_delete`.
  * A string alternative built on the vector implementation
    * Automatic null-pointer handling, for easy passing of strings 
to C.
  * A `minimal_rt` mode meant for environments where only a tiny 
subset of the D runtime is present, with custom handling of class 
destruction that doesn't use TypeInfo.
    * Eg. the port of D I'm making for the SEGA Dreamcast.

We plan to add more memory management utilities, thereby making 
writing completely GC-less D code a lot more user-friendly.

You can find the package here
https://code.dlang.org/packages/numem

Additionally, the `yxml` package uses numem's smart pointers and 
strings.
https://code.dlang.org/packages/yxml


More information about the Digitalmars-d-announce mailing list