Struct MmappedBuffer

A circular buffer which avoids moving data around, but instead maps the same physical memory block twice into two adjacent virtual memory blocks. It does move data blocks when growing the buffer.

Methods

Name Description
alloc Allocates space for at least n new objects of type T to be written to the buffer.
commit Adds first n objects of type T stored in the slice previously obtained using alloc.
consume Removes first n objects of type T from the buffer.
peek Returns a read-only slice, typed as const(T)[], containing all data currently available in the buffer.

Authors

Adrian Matoga

Copyright

© 2016 Adrian Matoga

License

BSL-1.0.