GC vs. Manual Memory Management Real World Comparison

Benjamin Thaut code at benjamin-thaut.de
Wed Sep 5 10:38:31 PDT 2012


Am 05.09.2012 19:31, schrieb Johannes Pfau:
>
> Would be great if some of the code could be merged into phobos,
> especially the memory tracker. But also things like memory or object
> pools would be great in phobos, an emplace wrapper which accepts a
> custom alloc function to replace new (and something similar for delete),
> etc. We really need a module for manual memory management (std.mmm?).
> And functions which currently use the GC to allocate should get
> overloads which take buffers (Or better support custom allocators, but
> that needs an allocator design first).
>

I personally really like my composite template, which allows for direct 
composition of one class instance into another. It does not introduce 
additional indirections and the compiler will remind you, if you forgett 
to initialize it.

https://github.com/Ingrater/druntime/blob/master/src/core/allocator.d#L670

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d-announce mailing list