Skip to content

Commit eabcdf0

Browse files
committed
Move get_rcl_allocator to the rclcpp namespace.
1 parent 264c263 commit eabcdf0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

demo_nodes_cpp/src/topics/allocator_tutorial.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ constexpr bool operator!=(
9292
return false;
9393
}
9494

95-
// You need to overload get_rcl_allocator for custom allocators.
95+
namespace rclcpp {
96+
97+
// You need to overload rclcpp::get_rcl_allocator for custom allocators.
9698
// This function needs to build an instance of rcl_allocator_t
9799
// for use in C code.
98100
template<typename T>
@@ -119,6 +121,8 @@ rcl_allocator_t get_rcl_allocator(MyAllocator<T>)
119121
return rcl_allocator;
120122
}
121123

124+
} // namespace rclcpp
125+
122126
// Override global new and delete to count calls during execution.
123127

124128
static bool is_running = false;

0 commit comments

Comments
 (0)