mmap#47
Draft
ThomasWaldmann wants to merge 6 commits into
Draft
Conversation
To prepare having the kv array in a single mmapped file, we need to have keys and values in one array, which we can easily extend at the end.
Introduce a dedicated `header` pointer that tracks the start of the mmap region. Extend `HEADER_FMT` to include `capacity`, `used`, and `kv_used` directly in the binary header (previously stored in the JSON metadata blob). The idea is that we can easily update these values without recreating the JSON inside the mmapped file. The JSON shall only contain stuff that does not change and that is difficult to map to a fixed layout. `__init__`: reconstructs hash table from KV array when opening an existing mmap file, replacing duplicated logic in `open_mmap` Fix `test_mmap_delete_persistence`: assertions were testing the inverse of the actual delete range (0..24 and 75..99 kept, 25..74 deleted)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #45.