Construct a buffer manager with a given allocator.
Add more data to the window of currently valid data. To avoid expensive reallocation, use avail to tune this call.
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.
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.
The window of currently valid data
The type of the elements the buffer will use
The allocator to use for adding more elements
The size that can be freely allocated before growth is restricted to 2x.
Based on concept by Dmitry Olshansky
Array based buffer manager. Uses custom allocator to get the data. Limits growth to doubling.