Skip to content

Commit

Permalink
stdx.allocator -> std.experimental.allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
denizzzka committed Feb 6, 2024
1 parent 5525731 commit 611e45c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
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

0 comments on commit 611e45c

Please sign in to comment.