| 1 |
@safe @nogc nothrow pure unittest |
| 2 |
{ |
| 3 |
import std.experimental.allocator.common; |
| 4 |
|
| 5 |
import std.experimental.allocator.building_blocks.null_allocator : NullAllocator; |
| 6 |
import std.experimental.allocator.mallocator : Mallocator; |
| 7 |
import std.experimental.allocator.gc_allocator : GCAllocator; |
| 8 |
import std.experimental.allocator.mmap_allocator : MmapAllocator; |
| 9 |
static assert(isAllocator!NullAllocator); |
| 10 |
static assert(isAllocator!Mallocator); |
| 11 |
static assert(isAllocator!GCAllocator); |
| 12 |
static assert(isAllocator!MmapAllocator); |
| 13 |
static assert(!isAllocator!int); |
| 14 |
} |
| 15 |
|
| 16 |
@safe @nogc nothrow pure unittest |
| 17 |
{ |
| 18 |
import std.experimental.allocator.common; |
| 19 |
|
| 20 |
import std.experimental.allocator.building_blocks.null_allocator : NullAllocator; |
| 21 |
import std.experimental.allocator.mallocator : Mallocator; |
| 22 |
import std.experimental.allocator.gc_allocator : GCAllocator; |
| 23 |
import std.experimental.allocator.mmap_allocator : MmapAllocator; |
| 24 |
struct S |
| 25 |
{ |
| 26 |
mixin AllocatorState!NullAllocator n; |
| 27 |
mixin AllocatorState!GCAllocator g; |
| 28 |
mixin AllocatorState!Mallocator m; |
| 29 |
mixin AllocatorState!MmapAllocator p; |
| 30 |
} |
| 31 |
static assert(S.sizeof == 1); |
| 32 |
} |
| 33 |
|