Announcing Elembuf

Cyroxin 34924561+Cyroxin at users.noreply.github.com
Mon Dec 17 21:16:16 UTC 2018


Elembuf is a library that allows writing efficient parsers and 
readers. It looks as if it were just a regular T[], making it 
work well with libraries and easy to use with slicing. To avoid 
copying, the buffer can only be at maximum one page long.

Internally it is a circular buffer with memory mirroring. The 
garbage collector should not be used for the buffer as it would 
remove the memory mapping functionality. In the future, work will 
be done to add support for a dynamic buffer that copies when 
resized and -betterC compatibility. It currently supports 
Windows, GlibC 2.27 and Posix systems.

You can create your own sources for the buffer, or you can 
directly write to the buffer. The project also comes with one 
example source: "NetSource", which can be used as a base for 
implementing the read interface of your own source, should you 
want to make one. The example source lacks major features and 
should only be used as a reference for your own source.

Code simplicity and ease of use are major goals for the project. 
More testing and community additions are needed. A good first 
contribution would be to add additional sources or fix current 
ones. Please Check it out on github and consider helping out: 
https://github.com/Cyroxin/Elembuf


More information about the Digitalmars-d-announce mailing list