Skip to content

Commit 7e9ff5f

Browse files
authored
accept custom allocator for LoanedMessage. (#2672)
* accept custom allocator for LoanedMessage. Signed-off-by: Tomoya Fujita <[email protected]> * move message allocator using directives to public. Signed-off-by: Tomoya Fujita <[email protected]> --------- Signed-off-by: Tomoya Fujita <[email protected]>
1 parent 64dd644 commit 7e9ff5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rclcpp/include/rclcpp/loaned_message.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ namespace rclcpp
3131
template<typename MessageT, typename AllocatorT = std::allocator<void>>
3232
class LoanedMessage
3333
{
34+
public:
3435
using MessageAllocatorTraits = rclcpp::allocator::AllocRebind<MessageT, AllocatorT>;
3536
using MessageAllocator = typename MessageAllocatorTraits::allocator_type;
3637

37-
public:
3838
/// Constructor of the LoanedMessage class.
3939
/**
4040
* The constructor of this class allocates memory for a given message type
@@ -57,7 +57,7 @@ class LoanedMessage
5757
*/
5858
LoanedMessage(
5959
const rclcpp::PublisherBase & pub,
60-
std::allocator<MessageT> allocator)
60+
MessageAllocator allocator)
6161
: pub_(pub),
6262
message_(nullptr),
6363
message_allocator_(std::move(allocator))

0 commit comments

Comments
 (0)