summaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.phobos/std_experimental_allocator_mallocator.d
blob: 76fb3ec253950e3eec91e2f998bca8fa7562479f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@nogc @system nothrow unittest
{
    import std.experimental.allocator.mallocator;

    auto buffer = Mallocator.instance.allocate(1024 * 1024 * 4);
    scope(exit) Mallocator.instance.deallocate(buffer);
    //...
}

pure @nogc @system nothrow unittest
{
    import std.experimental.allocator.mallocator;

    auto buffer = AlignedMallocator.instance.alignedAllocate(1024 * 1024 * 4,
        128);
    scope(exit) AlignedMallocator.instance.deallocate(buffer);
    //...
}