Hacker News new | ask | show | jobs
by gavinray 1083 days ago
"mmap" in the general case is incredibly useful.

There's so much you get "for free" and the UX/DX of reads/writes to it, especially if you're primarily operating on structs instead of raw byte/string data.

(Example, reading a file and "reinterpret_cast<>"'ing it from bytes to in-memory struct representations)

It's just that for the _particular_ case of a DBMS that relies on optimal I/O and transactionality, the general-purpose kernel implementation of mmap falls short of what you can implement by hand.