Use std.experimental.allocator and remove the custom allocator module.
This commit is contained in:
parent
55a06c30f3
commit
f74c30a9f3
9 changed files with 278 additions and 915 deletions
|
@ -122,11 +122,12 @@ interface OutputStream {
|
|||
protected final void writeDefault(InputStream stream, ulong nbytes = 0)
|
||||
@trusted // FreeListRef
|
||||
{
|
||||
import vibe.internal.memory : FreeListRef;
|
||||
import vibe.internal.allocator : theAllocator, make, dispose;
|
||||
|
||||
static struct Buffer { ubyte[64*1024] bytes = void; }
|
||||
auto bufferobj = FreeListRef!(Buffer, false)();
|
||||
auto buffer = bufferobj.bytes[];
|
||||
auto bufferobj = theAllocator.make!Buffer();
|
||||
scope (exit) theAllocator.dispose(bufferobj);
|
||||
auto buffer = bufferobj.bytes;
|
||||
|
||||
//logTrace("default write %d bytes, empty=%s", nbytes, stream.empty);
|
||||
if( nbytes == 0 ){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue