Add scalar type template parameter for buffers
This commit is contained in:
parent
f1bc4dc2e2
commit
e32af2d09e
@ -30,7 +30,7 @@ class IOCPStreamTransport : StreamTransport
|
||||
{
|
||||
private OverlappedConnectedSocket socket_;
|
||||
|
||||
private WriteBuffer input;
|
||||
private WriteBuffer!ubyte input;
|
||||
|
||||
/**
|
||||
* Creates new completion port transport.
|
||||
@ -45,12 +45,7 @@ class IOCPStreamTransport : StreamTransport
|
||||
body
|
||||
{
|
||||
socket_ = socket;
|
||||
input = MmapPool.instance.make!WriteBuffer(8192, MmapPool.instance);
|
||||
}
|
||||
|
||||
~this()
|
||||
{
|
||||
MmapPool.instance.dispose(input);
|
||||
input = WriteBuffer!ubyte(8192, MmapPool.instance);
|
||||
}
|
||||
|
||||
@property inout(OverlappedConnectedSocket) socket()
|
||||
|
@ -30,7 +30,7 @@ class SelectorStreamTransport : StreamTransport
|
||||
private ConnectedSocket socket_;
|
||||
|
||||
/// Input buffer.
|
||||
package WriteBuffer input;
|
||||
package WriteBuffer!ubyte input;
|
||||
|
||||
private SelectorLoop loop;
|
||||
|
||||
@ -46,15 +46,7 @@ class SelectorStreamTransport : StreamTransport
|
||||
{
|
||||
socket_ = socket;
|
||||
this.loop = loop;
|
||||
input = MmapPool.instance.make!WriteBuffer(8192, MmapPool.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the transport and deallocate the data buffers.
|
||||
*/
|
||||
~this() @nogc
|
||||
{
|
||||
MmapPool.instance.dispose(input);
|
||||
input = WriteBuffer!ubyte(8192, MmapPool.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,7 @@ class IOWatcher : ConnectionWatcher
|
||||
/**
|
||||
* Returns: Underlying output buffer.
|
||||
*/
|
||||
package ReadBuffer output;
|
||||
package ReadBuffer!ubyte output;
|
||||
|
||||
/**
|
||||
* Params:
|
||||
@ -157,7 +157,7 @@ class IOWatcher : ConnectionWatcher
|
||||
super();
|
||||
transport_ = transport;
|
||||
protocol_ = protocol;
|
||||
output = MmapPool.instance.make!ReadBuffer(8192, 1024, MmapPool.instance);
|
||||
output = ReadBuffer!ubyte(8192, 1024, MmapPool.instance);
|
||||
active = true;
|
||||
}
|
||||
|
||||
@ -166,7 +166,6 @@ class IOWatcher : ConnectionWatcher
|
||||
*/
|
||||
protected ~this() @nogc
|
||||
{
|
||||
MmapPool.instance.dispose(output);
|
||||
MmapPool.instance.dispose(protocol_);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -54,10 +54,9 @@ interface Allocator
|
||||
|
||||
/**
|
||||
* The mixin generates common methods for classes and structs using
|
||||
* allocators. It provides a protected member, constructor and a read-only
|
||||
* property, that checks if an allocator was already set and sets it to the
|
||||
* default one, if not (useful for structs which don't have a default
|
||||
* constructor).
|
||||
* allocators. It provides a protected member, constructor and a read-only property,
|
||||
* that checks if an allocator was already set and sets it to the default
|
||||
* one, if not (useful for structs which don't have a default constructor).
|
||||
*/
|
||||
mixin template DefaultAllocator()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user