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

Fix bad size during archive creation #2680

Merged
merged 1 commit into from Jun 7, 2017
Merged

Fix bad size during archive creation #2680

merged 1 commit into from Jun 7, 2017

Conversation

biddisco
Copy link
Contributor

@biddisco biddisco commented Jun 6, 2017

The archive size only grows if the data is written into the container,
when chunks are added, we do not need to increment the size of the
archive itself.

This fixes a bug where the archive containter is allocated with a much
larger size than needed.

The archive size only grows if the data is written into the container,
when chunks are added, we do not need to increment the size of the
archive itself.

This fixes a bug where the archive containter is allocated with a much
larger size than needed.
@biddisco biddisco changed the title Fix bad size and optimization flags during archive creation Fix bad size during archive creation Jun 6, 2017
Copy link
Member

@sithhell sithhell left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@biddisco
Copy link
Contributor Author

biddisco commented Jun 6, 2017

Looking at the parcel decode, I think I need to also add the same tweak to the deserialization chunk read as it also increments the "size" regardless of whether it uses the container or a chunk. Migh not matter since the number probably isn't used anywhere, but ...

@@ -31,7 +31,7 @@ namespace hpx { namespace serialization
naming::gid_type const & split_gid) = 0;
virtual void set_filter(binary_filter* filter) = 0;
virtual void save_binary(void const* address, std::size_t count) = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we do the same here as you did for the chunk? Let save_binary return the number of bytes written?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. I will add that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. Misread what you were referring to. For save_binary, it always writes out the number of bytes supplied, so it didn't seem necessary to return the value - but if it makes the code look more consistent, then I'll add it.

Copy link
Member

Choose a reason for hiding this comment

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

Yah, just for consistency's sake, no other reason...

@hkaiser hkaiser merged commit 827652f into master Jun 7, 2017
@hkaiser hkaiser deleted the fixing_2679 branch June 7, 2017 12:17
@biddisco
Copy link
Contributor Author

This fixed #2679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants