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

return errors from bitmap functions #205

Closed
bgoglin opened this issue Aug 9, 2016 · 1 comment
Closed

return errors from bitmap functions #205

bgoglin opened this issue Aug 9, 2016 · 1 comment

Comments

@bgoglin
Copy link
Contributor

bgoglin commented Aug 9, 2016

Most hwloc_bitmap_foo() functions may fail because when the array of ulongs has to be internally realloc'ed to larger (for instance when OR'ing a small bitmap with a long one). We should return 0/-1 to indicate success/failure.

@bgoglin bgoglin added the API label Aug 9, 2016
@bgoglin bgoglin added this to the v2.0 milestone Aug 9, 2016
bgoglin added a commit to bgoglin/hwloc that referenced this issue Dec 10, 2017
In case realloc'ing the array of ulongs ever fails.
free(), zero() and fill() are the only functions that still return void.

Even singlify() can fail if ever called on a bitmap that contains
0 in all preallocated ulongs and the infinite set
(we need to alloc an additional ulong and set to 0x1).

from_ulong() doesn't currently ever fail but it could if we
ever preallocate 0 ulongs.

Clsoes open-mpi#205.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
bgoglin added a commit that referenced this issue Dec 10, 2017
In case realloc'ing the array of ulongs ever fails.
free(), zero() and fill() are the only functions that still return void.

Even singlify() can fail if ever called on a bitmap that contains
0 in all preallocated ulongs and the infinite set
(we need to alloc an additional ulong and set to 0x1).

from_ulong() doesn't currently ever fail but it could if we
ever preallocate 0 ulongs.

Clsoes #205.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
@bgoglin
Copy link
Contributor Author

bgoglin commented Dec 10, 2017

Fixed in 5bc384f

@bgoglin bgoglin closed this as completed Dec 10, 2017
rools32 pushed a commit to rools32/hwloc that referenced this issue Jan 24, 2018
In case realloc'ing the array of ulongs ever fails.
free(), zero() and fill() are the only functions that still return void.

Even singlify() can fail if ever called on a bitmap that contains
0 in all preallocated ulongs and the infinite set
(we need to alloc an additional ulong and set to 0x1).

from_ulong() doesn't currently ever fail but it could if we
ever preallocate 0 ulongs.

Clsoes open-mpi#205.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant