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"
27#include "fastrtps/config.h"
43template <
typename MemoryPool>
45 std::size_t node_size,
48 FASTDDS_DEPRECATED_UNTIL(3,
"eprosima::fastrtps::memory_pool_block_size",
"You should not use this method")
49 namespace fm = foonathan::memory;
58 * ((node_size > MemoryPool::min_node_size ? node_size : MemoryPool::min_node_size)
59#
if FOONATHAN_MEMORY_DEBUG_DOUBLE_DEALLOC_CHECK
60 * (fm::detail::debug_fence_size ? 3 : 1))
62 + (fm::detail::debug_fence_size ? 2 * fm::detail::max_alignment : 0))
64#ifdef FOONATHAN_MEMORY_MEMORY_POOL_HAS_MIN_BLOCK_SIZE
65 + fm::detail::memory_block_stack::implementation_offset();
67 + fm::detail::memory_block_stack::implementation_offset;
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:44
eProsima namespace.
Definition LibrarySettingsAttributes.h:23
Specifies the configuration of a resource limited collection.
Definition ResourceLimitedContainerConfig.hpp:36
size_t increment
Number of items to add when capacity limit is reached.
Definition ResourceLimitedContainerConfig.hpp:53
size_t maximum
Maximum number of elements allowed in the collection.
Definition ResourceLimitedContainerConfig.hpp:51
size_t initial
Number of elements to be preallocated in the collection.
Definition ResourceLimitedContainerConfig.hpp:49