vibe-core/source/vibe/internal/allocator.d
Sönke Ludwig 58ee4a8839
Use a thread local allocator instead of processAllocator in HashMap.
This is required since processAllocator returns an ISharedAlloactor since 2.075.0. Because HashMap is operating only thread-local, this should generally be safe.
2017-06-28 17:22:13 +02:00

19 lines
798 B
D

module vibe.internal.allocator;
public import std.experimental.allocator;
public import std.experimental.allocator.building_blocks.allocator_list;
public import std.experimental.allocator.building_blocks.null_allocator;
public import std.experimental.allocator.building_blocks.region;
public import std.experimental.allocator.building_blocks.stats_collector;
public import std.experimental.allocator.gc_allocator;
public import std.experimental.allocator.mallocator;
// NOTE: this needs to be used instead of theAllocator due to Phobos issue 17564
@property IAllocator vibeThreadAllocator()
@safe nothrow @nogc {
static IAllocator s_threadAllocator;
if (!s_threadAllocator)
s_threadAllocator = () @trusted { return allocatorObject(GCAllocator.instance); } ();
return s_threadAllocator;
}