Debian Codegraph @

libphobos/testsuite/libphobos.phobos/std_experimental_allocator_gc_allocator.d

raw
1 pure @system unittest
2 {
3 import std.experimental.allocator.gc_allocator;
4
5 auto buffer = GCAllocator.instance.allocate(1024 * 1024 * 4);
6 // deallocate upon scope's end (alternatively: leave it to collection)
7 scope(exit) GCAllocator.instance.deallocate(buffer);
8 //...
9 }
10