infoforcefeed/OlegDB — pull request #85 by qpfiffer (2014-06-05 23:05:42+00:00)
Title: Mmap redo

This branch has quite a lot of shit in it. The main thing being that values are no longer stored directly in memory, but instead in a `mmap()`'d region of memory stored in the same directory as the aol file. The values file is allocated 4MB at a time (defined in `include/defs.h`) to align with pages in-memory/on-disk.

The aol file now no longer directly stores data, but instead stores offsets into the values file. This makes the aol file only metadata.

There are other small improvements as well, mainly refactor stuff and the addition of `file.c/.h` to hold some common file operations.

Caveats:
- We'll now have to write a compaction function to remove dead chunks of memory in the values file at some point
- The erlang frontend will need to handle ctrl+c gracefully to ensure that files are sync to disk

Please go over this one pretty well, It's kind of complex.

/cc @Hamcha @kyleterry @colby