From 12612eecda3d4e0cab81a7576b1a9e708f24b0c0 Mon Sep 17 00:00:00 2001 From: Jackie Kay Date: Tue, 21 Jul 2015 14:21:52 -0700 Subject: [PATCH] Fix static memory strategy --- .../include/rclcpp/strategies/static_memory_strategy.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rclcpp/include/rclcpp/strategies/static_memory_strategy.hpp b/rclcpp/include/rclcpp/strategies/static_memory_strategy.hpp index d01f4ee078..08dc325da2 100644 --- a/rclcpp/include/rclcpp/strategies/static_memory_strategy.hpp +++ b/rclcpp/include/rclcpp/strategies/static_memory_strategy.hpp @@ -47,10 +47,6 @@ class StaticMemoryStrategy : public memory_strategy::MemoryStrategy for (size_t i = 0; i < pool_size_; ++i) { memory_map_[memory_pool_[i]] = 0; } - - for (size_t i = 0; i < max_executables_; ++i) { - executable_pool_[i] = std::make_shared(executor::AnyExecutable()); - } } void ** borrow_handles(HandleType type, size_t number_of_handles) @@ -116,7 +112,7 @@ class StaticMemoryStrategy : public memory_strategy::MemoryStrategy size_t prev_exec_seq_ = exec_seq_; ++exec_seq_; - return executable_pool_[prev_exec_seq_]; + return std::make_shared(executable_pool_[prev_exec_seq_]); } void * alloc(size_t size) @@ -161,7 +157,7 @@ class StaticMemoryStrategy : public memory_strategy::MemoryStrategy void * service_pool_[max_services_]; void * client_pool_[max_clients_]; void * guard_condition_pool_[max_guard_conditions_]; - executor::AnyExecutable::SharedPtr executable_pool_[max_executables_]; + executor::AnyExecutable executable_pool_[max_executables_]; size_t pool_seq_; size_t exec_seq_;