 |
Fast RTPS
Version 2.1.0
Fast RTPS
|
20 #ifndef FASTRTPS_UTILS_COLLECTIONS_FOONATHAN_MEMORY_HELPERS_HPP_
21 #define FASTRTPS_UTILS_COLLECTIONS_FOONATHAN_MEMORY_HELPERS_HPP_
23 #include <foonathan/memory/memory_pool.hpp>
24 #include <foonathan/memory/detail/debug_helpers.hpp>
26 #include "ResourceLimitedContainerConfig.hpp"
42 template <
typename MemoryPool>
44 std::size_t node_size,
47 #ifdef FOONATHAN_MEMORY_MEMORY_POOL_HAS_MIN_BLOCK_SIZE
49 return MemoryPool::min_block_size(node_size, limits.
initial ? limits.
initial : 1);
59 * ((node_size > MemoryPool::min_node_size ? node_size : MemoryPool::min_node_size)
60 * (foonathan::memory::detail::debug_fence_size ? 3 : 1))
61 + foonathan::memory::detail::memory_block_stack::implementation_offset;
62 #endif // FOONATHAN_MEMORY_MEMORY_POOL_HAS_MIN_BLOCK_SIZE
size_t initial
Number of elements to be preallocated in the collection.
Definition: ResourceLimitedContainerConfig.hpp:47
size_t increment
Number of items to add when capacity limit is reached.
Definition: ResourceLimitedContainerConfig.hpp:51
std::size_t memory_pool_block_size(std::size_t node_size, const ResourceLimitedContainerConfig &limits)
A helper to calculate the block size of a memory pool given the size of the node and a resource limit...
Definition: foonathan_memory_helpers.hpp:43
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
Specifies the configuration of a resource limited collection.
Definition: ResourceLimitedContainerConfig.hpp:34
size_t maximum
Maximum number of elements allowed in the collection.
Definition: ResourceLimitedContainerConfig.hpp:49