feat: share mmap handle inbetween snapshot providers & cursors#5162
feat: share mmap handle inbetween snapshot providers & cursors#5162
Conversation
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
mattsse
left a comment
There was a problem hiding this comment.
only style nits,
lgtm otherwise
|
|
||
| // SAFETY: File is read-only and its descriptor is kept alive as long as the mmap handle. | ||
| let mmap = unsafe { Mmap::map(&file)? }; | ||
| pub fn new( |
There was a problem hiding this comment.
this needs some docs about when to pass an option, but I'd prefer a separate function with_handle that directly accepts the mmapHandle
| let header = Header::decompress( | ||
| cursor.row_by_key_with_cols::<0b01, 2>(&block_hash.0).unwrap().unwrap()[0], | ||
| ) | ||
| .unwrap(); |
There was a problem hiding this comment.
these should be errors, but fine with cleaning this up separately
There was a problem hiding this comment.
yeah, next PR is actually implementing the HeaderProvider, and will clean this up
Codecov Report
... and 470 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
PR into #5139
MmapHandle(struct over file and mmap arc) andLoadedJar(struct over mmap handle and jar)