-
Notifications
You must be signed in to change notification settings - Fork 341
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
Revert "Use sizeof(char) in place for sizeof(void) (#515)" #516
Conversation
This reverts commit c3769dd. Signed-off-by: Michel Hidalgo <[email protected]>
@ros-pull-request-builder retest this please |
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.
I may not be qualified to review this, but I'm trying to reconcile a couple of different statements made around this area:
- Do not attempt to use void allocators for memory allocation. rclcpp#1657 (comment) says "it doesn't cover custom void allocators (which shouldn't have allocate nor deallocate methods to begin with)."
- https://en.cppreference.com/w/cpp/memory/allocator says "The explicit specialization for void lacks the member typedefs reference, const_reference, size_type and difference_type. This specialization declares no member functions. " (which agrees with the above statement)
- This file (allocator_tutorial.cpp) declares
struct MyAllocator
, which by default hastypename T = void
, and also has implementations ofallocate
anddeallocate
. Doesn't that directly contradict the above two statements?
Exactly. It shouldn't have them. Alas, many |
OK, thanks, that makes some sense. Just be totally sure I understand, then, the problem here is not really that |
It is being instantiated with a |
Alright, thanks for the reviews ! Going in. |
This reverts commit c3769dd.
I was wrong.
void
allocators shouldn't behave likechar
allocators. See ros2/rclcpp#1657.