Skip to content

Conversation

@ggouaillardet
Copy link
Contributor

Correctly reallocate the bitmap when needed

Signed-off-by: Gilles Gouaillardet gilles@rist.or.jp

Correctly reallocate the bitmap when needed

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
@ggouaillardet
Copy link
Contributor Author

@bosilca can you please review this ?

also, when new_size > bm->max_size, we do not realloc all the bytes, and setting the requested bit will cause an array overflow. should we error or simply do nothing in this case ?

Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

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

This looks ok to me -- I don't even understand what the original calculation was trying to do...

@jsquyres
Copy link
Member

@bosilca Can you double check this commit?

@bosilca
Copy link
Member

bosilca commented May 26, 2018

I quickly check the usages of the bitmap and we in the current code we never go outside the original size. But having checks for corner cases is good practice.

rhc54 pushed a commit to rhc54/openpmix that referenced this pull request May 27, 2018
Backport of open-mpi/ompi#4670

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
@jsquyres
Copy link
Member

@bosilca This still has the corner case checks, right? It looks like a minor optimization to me.

@bosilca
Copy link
Member

bosilca commented May 29, 2018

@jsquyres you're right. This is good to go.

@bosilca bosilca merged commit 4ebed21 into open-mpi:master May 29, 2018
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.

3 participants