The search functionality needs JavaScript enabled
Struct AllocatedBuffer Array based buffer manager. Uses custom allocator to get the data. Limits
growth to doubling.
struct AllocatedBuffer (T, Allocator, ulong floorSize = 8192 )
;
Constructors
Name Description
this
(alloc)
Construct a buffer manager with a given allocator.
Fields
Name Type Description
_allocator
Allocator
Construct a buffer manager with a given allocator.
Properties
Name Type Description
allocator
[get]
Allocator
Construct a buffer manager with a given allocator.
Methods
Name Description
avail
()
capacity
()
extend
(request)
Add more data to the window of currently valid data. To avoid expensive
reallocation, use avail to tune this call.
releaseBack
(elements)
Give bytes back to the buffer manager from the back of the buffer.
These bytes can be removed in this operation or further operations and
should no longer be used.
releaseFront
(elements)
Give bytes back to the buffer manager from the front of the buffer.
These bytes can be removed in this operation or further operations and
should no longer be used.
window
()
The window of currently valid data
Parameters
Name Description
T The type of the elements the buffer will use
Allocator The allocator to use for adding more elements
floorSize The size that can be freely allocated before growth is restricted to 2x.
Based on concept by Dmitry Olshansky