On 31/03/2018 9:46 AM, Per Nordlöw wrote:
On Friday, 30 March 2018 at 20:38:35 UTC, rikki cattermole wrote:
Use a custom allocator (that could be backed by the GC) using
std.experimental.allocators :)
https://dlang.org/phobos/std_experimental_allocator.html
is massive.
I guess I should allocate my nodes using
auto node = theAllocator.make!StrNode("alpha");
Could someone please give a working example of a GC-backed
`theAllocator` suitable for my allocation pattern?
The default theAllocator is the GC :)
Also see[0] and "Sample Assembly"[1] which will really interest you I think.
[0] https://dlang.org/phobos/std_experimental_allocator_gc_allocator.html
[1] https://dlang.org/phobos/std_experimental_allocator_building_blocks.html