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
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
This fixed #2679 |
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.