streams, property descriptor, serializer, binder, etc.
To use this package, put the following dependency into your project's dependencies section:
iz is a general purpose library for the D programming language. It includes streams, containers, a serializer, property binder, Pascal-like sets, Pascal-like properties and more.
destroycalls the destructors from the most derived to the base using the dynamic type information of each generation and without considering the static type of the argument (which may be correct).
destructcalls the destructor defined for the static type of the argument unless it is passed after a cast to
Object. Even in this case, only the most derived destructor gets looked-up using the type information. Once found, the other destructors are called by inheritance (i.e like what does
super()to constructors). This system, since not built into the language, is provided with a mixin template.
As a consequence,
destroy or the GC will segfault, due to a double call to the destructors, if iz classes that do not directly inherit from
Object (i.e non-empty inheritance list) are not accurately handled with
Still because of manual memory management, D arrays (e.g
int a;) are not really usable in iz classes.
A D arrays consists of two members. One of them is a pointer that's managed by the garbage collector. Since the arrays parents, classes or structs, are not known by the GC, during any collection the GC thinks that a D array is orphan and it frees the chunk pointed by the pointer. By default this library uses GC-free arrays in its classes and other aggregates. Any container based on custom allocators will also be compatible with iz class system.
In order to use default D arrays two workarounds exist:
GC.disableat the beginning of the program.
Appender. Uses local copies in order to work safely with Phobos algorithms.
Note that D arrays are not affected when used as local variables. This is even a case where the GC is useful. The lifetime of the aggregates is often known and deterministic so the associated memory can then be considered as polluting the GC heap.
Build and setup
- using Coedit: open the file iz.coedit in the project menu, item open, compile, install in the libman.
- using DUB,
dub build --build=release.
- using shell scripts, see the scripts folder.