Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert back stdx.allocator -> std.experimental.allocator ? #383

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions source/vibe/internal/allocator.d
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
module vibe.internal.allocator;

public import stdx.allocator;
public import stdx.allocator.building_blocks.allocator_list;
public import stdx.allocator.building_blocks.null_allocator;
public import stdx.allocator.building_blocks.region;
public import stdx.allocator.building_blocks.stats_collector;
public import stdx.allocator.gc_allocator;
public import stdx.allocator.mallocator;

// NOTE: this needs to be used instead of theAllocator due to Phobos issue 17564
@property IAllocator vibeThreadAllocator()
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;

alias VibeAllocator = RCIAllocator;

@property VibeAllocator vibeThreadAllocator()
@safe nothrow @nogc {
static IAllocator s_threadAllocator;
if (!s_threadAllocator)
s_threadAllocator = () @trusted { return allocatorObject(GCAllocator.instance); } ();
return s_threadAllocator;
return theAllocator();
}

auto makeGCSafe(T, Allocator, A...)(Allocator allocator, A args)
Expand Down
4 changes: 2 additions & 2 deletions source/vibe/internal/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ struct AllocAppender(ArrayType : E[], E) {
private {
ElemType[] m_data;
ElemType[] m_remaining;
IAllocator m_alloc;
VibeAllocator m_alloc;
bool m_allocatedBuffer = false;
}

this(IAllocator alloc, ElemType[] initial_buffer = null)
this(VibeAllocator alloc, ElemType[] initial_buffer = null)
@safe {
m_alloc = alloc;
m_data = initial_buffer;
Expand Down
Loading