Skip to content

Commit

Permalink
Move get_rcl_allocator to the rclcpp namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewolter committed Oct 27, 2020
1 parent 264c263 commit eabcdf0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo_nodes_cpp/src/topics/allocator_tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ constexpr bool operator!=(
return false;
}

// You need to overload get_rcl_allocator for custom allocators.
namespace rclcpp {

// You need to overload rclcpp::get_rcl_allocator for custom allocators.
// This function needs to build an instance of rcl_allocator_t
// for use in C code.
template<typename T>
Expand All @@ -119,6 +121,8 @@ rcl_allocator_t get_rcl_allocator(MyAllocator<T>)
return rcl_allocator;
}

} // namespace rclcpp

// Override global new and delete to count calls during execution.

static bool is_running = false;
Expand Down

0 comments on commit eabcdf0

Please sign in to comment.