-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Fixed asserts due to H5Pset_est_link_info() values #4081
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,25 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf | |
assert(link_size); | ||
|
||
/* Compute size of header to use for creation */ | ||
hdr_size = linfo_size + ginfo_size + pline_size + (ginfo->est_num_entries * link_size); | ||
|
||
/* Basic header size */ | ||
hdr_size = linfo_size + ginfo_size + pline_size; | ||
|
||
/* If this is likely to be a compact group, add space for the link | ||
* messages, unless the size of the link messages is greater than | ||
* the largest allowable object header message size, since the size | ||
* of the link messages is the size of the NIL spacer message that | ||
* would have to be written out to reserve enough space to hold the | ||
* links if the group were left empty. | ||
*/ | ||
bool compact = ginfo->est_num_entries <= ginfo->max_compact; | ||
if (compact) { | ||
|
||
size_t size_of_links = ginfo->est_num_entries * link_size; | ||
|
||
if (size_of_links < H5O_MESG_MAX_SIZE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you want to compare There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just the links. The other stuff goes in other messages. |
||
hdr_size += size_of_links; | ||
} | ||
} /* end if */ | ||
else | ||
hdr_size = (size_t)(4 + 2 * H5F_SIZEOF_ADDR(f)); | ||
|
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.
We don't normally declare variables inline like this. Why not just put the comparison in the 'if' statement?
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.
It's significantly uglier