Comments (3)
https://github.com/ros2/rcl/blob/master/rcl/include/rcl/allocator.h#L45-L52
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.
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
That needs realloc
to be set, because it just wraps it and deallocates the input pointer even if the alloc fails, i.e. the behavior of reallocf
.
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 realloc
pointer should not be null?
from rcl.
Maybe it was just wishful thinking on my part.
As a side note, since realloc is not provided in std::allocator_traits
, I created realloc from dealloc and alloc in rclcpp. Unfortunately my approach didn't work on Windows (caused a segfault in every rclcpp test). I've thrown up my hands in despair and ifdef'd out custom allocators in Windows so that the use_rcl branch can get merged:
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.
from rcl.
Ok, well unless you think we should change it, can you close the issue?
from rcl.
Related Issues (20)
- uninformative crash and error message for invalid parameter override HOT 2
- Question about intended behavior of attempts in verifySubsystemCount
- valgrind: Mismatched free / delete and other leaks HOT 7
- :farmer: Flaky test `test_graph__rmw_fastrtps_cpp` on ros2 buildfarm HOT 1
- transition events don't populate transition id, label, or timestamp
- yaml tag full support in rcl_yaml_param_parser HOT 3
- Anonymous Nodes HOT 6
- Custom logging allocator not passed to rcutils_logging_initialize_with_allocator HOT 4
- Log call from rcl_init (i.e. before logging is initialized) HOT 17
- Rosout publisher always gets standard allocator HOT 4
- Contradicting code docs for rcl_publish and rmw_publish HOT 2
- rcl_node_init uses wrong return code HOT 4
- Flaky test on Windows on the buildfarm: test_logging_rosout__rmw_connextdds
- master branch is behind rolling branch HOT 2
- Test `test_graph__rmw_connextdds` failing on nightly_win_rep
- Fix durability of service introspection topics HOT 9
- Remove `localhost_only` option for turtule-J HOT 1
- Dynamically remap topic names HOT 8
- Feature request: Sending an Action goal can be complexed, require difficult steps HOT 2
- Public API for remap_rule_t / node_option_t::arguments::remap_rules? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcl.