-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use foonathan memory manager for reducing allocations in SharedMemMan…
…ager.hpp (#3833) (#3889) * Use foonathan memory manager for reducing allocations in SharedMemManager.hpp (#3833) * Add helpers for std::list node sizes. Signed-off-by: Matthias Schneider <[email protected]> * Use foonathan memory pool for storing buffer nodes in shared mem manager in order to reduce dynamic heap allocations. Signed-off-by: Matthias Schneider <[email protected]> * Uncrustify. Signed-off-by: Matthias Schneider <[email protected]> * Add foonathan dependency to SharedMemTests. Signed-off-by: Matthias Schneider <[email protected]> * Initialize allocator with more realistic allocation assumption. * Fix include order Signed-off-by: Miguel Company <[email protected]> * Removed unnecessary constexpr. Signed-off-by: Miguel Company <[email protected]> * Fix copyright year. Signed-off-by: Miguel Company <[email protected]> * Fix EOL. Signed-off-by: Miguel Company <[email protected]> * Fix windows build of unit test. Signed-off-by: Miguel Company <[email protected]> --------- Signed-off-by: Matthias Schneider <[email protected]> Signed-off-by: Miguel Company <[email protected]> Co-authored-by: Miguel Company <[email protected]> (cherry picked from commit df18056) # Conflicts: # test/unittest/transport/CMakeLists.txt Signed-off-by: EduPonz <[email protected]> * Fix conflicts Signed-off-by: Miguel Company <[email protected]> Signed-off-by: EduPonz <[email protected]> --------- Signed-off-by: Matthias Schneider <[email protected]> Signed-off-by: Miguel Company <[email protected]> Signed-off-by: EduPonz <[email protected]> Co-authored-by: Matthias Schneider <[email protected]> Co-authored-by: Miguel Company <[email protected]>
- Loading branch information
1 parent
cb65fcd
commit 0f46e43
Showing
5 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/cpp/utils/collections/impl/node-sizes/foonathan/list_node_size_impl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file list_node_size_impl.hpp | ||
*/ | ||
|
||
#ifndef SRC_CPP_UTILS_COLLECTIONS_IMPL_FOONATHAN_LIST_NODE_SIZE_IMPL_HPP_ | ||
#define SRC_CPP_UTILS_COLLECTIONS_IMPL_FOONATHAN_LIST_NODE_SIZE_IMPL_HPP_ | ||
|
||
template <typename T> | ||
struct list_node_size : foonathan::memory::list_node_size<typename std::list<T>::value_type> | ||
{ | ||
}; | ||
|
||
#endif /* SRC_CPP_UTILS_COLLECTIONS_IMPL_FOONATHAN_LIST_NODE_SIZE_IMPL_HPP_ */ |
34 changes: 34 additions & 0 deletions
34
src/cpp/utils/collections/impl/node-sizes/list_node_size_impl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file list_node_size_impl.hpp | ||
*/ | ||
|
||
#ifndef SRC_CPP_UTILS_COLLECTIONS_IMPL_LIST_NODE_SIZE_IMPL_HPP_ | ||
#define SRC_CPP_UTILS_COLLECTIONS_IMPL_LIST_NODE_SIZE_IMPL_HPP_ | ||
|
||
#include "./config.hpp" | ||
|
||
#if defined(USE_FOONATHAN_NODE_SIZES) | ||
#include "foonathan/list_node_size_impl.hpp" | ||
#elif defined(USE_STD_NODE_SIZES) | ||
#include "std/list_node_size_impl.hpp" | ||
#elif defined(USE_CUSTOM_NODE_SIZES) | ||
#include "custom/list_node_size_impl.hpp" | ||
#else | ||
#error "Don't now which list_node_size implementation to use" | ||
#endif // NODE SIZE CONFIG | ||
|
||
#endif /* SRC_CPP_UTILS_COLLECTIONS_IMPL_LIST_NODE_SIZE_IMPL_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters