Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Improved API of mmap #1205

Merged
merged 1 commit into from Aug 4, 2022
Merged

Conversation

ritchie46
Copy link
Collaborator

@ritchie46 ritchie46 commented Aug 4, 2022

Two changes.

1. expose more information on the FileMetaData.

I wanted to know how many Chunks there are in the IPC file. This also exposes the size attribute as that can also be valuable information.

If they are an invariant for unsafe code, I can expose them via functions?

2. use Arc

There was an assumption that Arc<Mmap implements Clone + AsRef<[u8]. It does not. Calling as_ref on an Arc<T> gives us T, which was opaque to us.

Changed the function signature so that we can pass an Arc<Mmap>.

@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #1205 (fed029b) into main (5711cfc) will increase coverage by 0.01%.
The diff coverage is 93.61%.

@@            Coverage Diff             @@
##             main    #1205      +/-   ##
==========================================
+ Coverage   83.53%   83.54%   +0.01%     
==========================================
  Files         368      368              
  Lines       37448    37448              
==========================================
+ Hits        31283    31287       +4     
+ Misses       6165     6161       -4     
Impacted Files Coverage Δ
src/io/ipc/read/reader.rs 96.32% <ø> (ø)
src/mmap/mod.rs 84.84% <76.92%> (ø)
src/ffi/mmap.rs 96.74% <100.00%> (ø)
src/bitmap/utils/slice_iterator.rs 97.56% <0.00%> (-1.22%) ⬇️
src/io/ipc/read/file_async.rs 61.19% <0.00%> (+0.74%) ⬆️
src/io/ipc/read/stream_async.rs 76.71% <0.00%> (+2.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ritchie46 ritchie46 changed the title IPC FileMetaData: expose sizes IPC MMap: integration changes Aug 4, 2022
@ritchie46
Copy link
Collaborator Author

I will update the tests tonight.

@jorgecarleitao jorgecarleitao changed the title IPC MMap: integration changes Improved API of mmap Aug 4, 2022
@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label Aug 4, 2022
@jorgecarleitao jorgecarleitao merged commit 35b65c4 into jorgecarleitao:main Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants