From 1c0d891d9cd9feb0d41bc5df73cc0254cba89c40 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Mon, 10 May 2021 15:26:02 -0300 Subject: [PATCH] Revert "Use sizeof(char) in place for sizeof(void) (#515)" (#516) This reverts commit c3769dd063e6c16b6fe1d3f2943408a40ff58ec6. Signed-off-by: Michel Hidalgo --- demo_nodes_cpp/src/topics/allocator_tutorial.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/demo_nodes_cpp/src/topics/allocator_tutorial.cpp b/demo_nodes_cpp/src/topics/allocator_tutorial.cpp index b3df3b883..ba1ecc8c9 100644 --- a/demo_nodes_cpp/src/topics/allocator_tutorial.cpp +++ b/demo_nodes_cpp/src/topics/allocator_tutorial.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include "rclcpp/rclcpp.hpp" @@ -57,10 +56,7 @@ struct MyAllocator return nullptr; } num_allocs++; - // Use sizeof(char) in place for sizeof(void) - constexpr size_t value_size = sizeof( - typename std::conditional::value, T, char>::type); - return static_cast(std::malloc(size * value_size)); + return static_cast(std::malloc(size * sizeof(T))); } void deallocate(T * ptr, size_t size)