Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update random-access-storage to 3.0.0 #15

Merged
merged 3 commits into from
Aug 22, 2019
Merged

Conversation

bltavares
Copy link
Member

@bltavares bltavares commented Aug 4, 2019

Choose one: 🐛 + 🙋

Checklist

  • tests pass

Context

This bumps random-access-storage to 3.0.0, and fixes compilation
errors necessary on the process.

This commit implements sync_all using Ok(()) as suggested on the PR
introducing the method as I've understood we are using Vec and they
are not buffered.

Related to datrs/random-access-storage#6
Related to datrs/random-access-storage#18
Related to datrs/random-access-storage#17
Closes #14

Semver Changes

Major bump, as signatures have changed

This bumps `random-access-storage` to 3.0.0, and fixes compilation
errors necessary on the process.

This commit implements `sync_all` using `Ok(())` as suggested on the PR
introducing the method as I've understood we are using `Vec` and they
are not buffered.

Related to datrs/random-access-storage#6
Related to datrs/random-access-storage#18
Related to datrs/random-access-storage#17
Closes datrs#14
When running 'rustup component add' we are receiveing a message that it is not available on nightly.

> component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is unavailable for download for channel 'nightly'

This commit changes it to run using stable channel instead.
src/lib.rs Outdated
@@ -16,20 +16,19 @@ use std::io;
#[derive(Debug)]
pub struct RandomAccessMemory {
/// The length length of each buffer.
page_size: usize,
page_size: u64,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, I didn't quite understand the change, and I've changed all usize items used on the function to be u64. After doing that, and trying to understand it better, it might not be correct, right?

Given we are using a Vec as our backing store, should the page_size should remain usize?

Should length also be usize to pass to the user of the API that this crate only handles 4G as memory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think page_size should remain usize as it must be less than usize::max_value() to fit into the address space. Also, I guess in practice it will be much smaller than usize::max_value().

As for length, it should be u64 to handle large (sparse) storage. The current implementation doesn't seem to handle it properly, but it could (see #17).

@bltavares
Copy link
Member Author

I've applied the changes on page_size to make it usize again. I've gave it a try on casting fixes but I might be making mistakes still

@khernyo
Copy link
Member

khernyo commented Aug 22, 2019

This looks great, thank you!

@khernyo khernyo merged commit e435272 into datrs:master Aug 22, 2019
@bltavares bltavares deleted the bump-deps branch August 22, 2019 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants