std.experimental.allocator and @nogc

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 21 13:15:10 PDT 2016


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 
AllocatorList.allocate by hand, it works.

Is this probably a bug in how dmd deduce function properties?


More information about the Digitalmars-d-learn mailing list