What happens if the program unexpectedly terminates during an update to these persistent data structures? Is the mmap'ed file corrupted, or still in a usable state?
This problem is generally hard. See [Ensuring data reaches disk](https://lwn.net/Articles/457667/)