On Mon, Dec 17, 2018 at 09:16:16PM +0000, Cyroxin via Digitalmars-d-announce wrote: > 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. [...]
What advantage does this have over using std.mmfile to mmap() the input file into the process' address space, and just using it as an actual T[] -- which the OS itself will manage the paging for, with basically no extraneous copying except for what is strictly necessary to transfer it to/from disk, and with no arbitrary restrictions? (Or, if you don't like the fact that std.mmfile uses a class, calling mmap() / the Windows equivalent directly, and taking a slice of the result?) T -- My program has no bugs! Only undocumented features...
