-
Notifications
You must be signed in to change notification settings - Fork 163
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
Is documentation for reallocate consistent? #47
Comments
This linked comment doesn't mention that realloc can be a null function. I think the meaning (of this comment) is that any function pointed to from here should do the realloc behavior if possible, but if not it should alloc and then dealloc if successful.
That needs So I don't think it's out of step, but maybe I'm reading it differently than you. Is there a clearer statement which indicates that the |
Maybe it was just wishful thinking on my part. As a side note, since realloc is not provided in ros2/rclcpp@c1fc16e#diff-43afa33f042770415fd58f1b74c20fcdR72 But my next step will probably be to play around with realloc on Windows to see if we can make it work and if API changes will need to be made to rcl. |
Ok, well unless you think we should change it, can you close the issue? |
change gmock test to gtest
…y_set only persist the rmw impl if it was explicitly set
https://github.com/ros2/rcl/blob/master/rcl/include/rcl/allocator.h#L45-L52
The comment for "reallocate" implies to me that if the field is left null, then a reallocate function will be constructed from "deallocate" and "allocate". I wasn't sure where in the implementation this actually happens though; it seems as if
realloc
will simply throw an error in this case.https://github.com/ros2/rcl/blob/master/rcl/src/rcl/allocator.c#L54-L64
There are also several places were an error is returned in reallocate is null, e.g. https://github.com/ros2/rcl/blob/master/rcl/src/rcl/wait.c#L126-L127
It's not an issue in terms of what's needed in the implementation, but we should take a moment to make sure implementation and documentation are consistent.
The text was updated successfully, but these errors were encountered: