std.experimental.allocator and @nogc

2016-07-21 Thread Yuxuan Shui via Digitalmars-d-learn
I was trying to use allocators in a @nogc function. I tried FreeList!Mallocator and it works fine. But AllocatorList!Mallocator doesn't work. dmd complains that AllocatorList.allocate is not @nogc, even when BookkeepingAllocator is NullAllocator. But if I add '@nogc' to

std.experimental.allocator and @nogc?

2016-04-11 Thread Danni Coy via Digitalmars-d-learn
Lets assume I want to be able to swap in and out allocators none of which will be the gc_allocator... What is best practice for using std.experimental.allocator in @nogc code?