9 #ifndef SE_MEMORY_POOL_HPP 10 #define SE_MEMORY_POOL_HPP 12 #include <Eigen/Dense> 13 #include <boost/pool/pool.hpp> 19 template<
typename NodeT,
typename BlockT>
33 inline NodeT*
allocateNode(
const Eigen::Vector3i& node_coord,
const unsigned int node_size)
47 inline NodeT*
allocateNode(NodeT* parent_ptr,
const int child_idx,
const DataType init_data)
49 return new (
node_buffer_.malloc()) NodeT(parent_ptr, child_idx, init_data);
61 inline BlockT*
allocateBlock(NodeT* parent_ptr,
const int child_idx,
const DataType init_data)
63 return new (
block_buffer_.malloc()) BlockT(parent_ptr, child_idx, init_data);
90 #endif // SE_MEMORY_POOL_HPP void deleteNode(NodeT *node_ptr)
Delete a given node.
Definition: memory_pool.hpp:69
boost::pool block_buffer_
The block buffer.
Definition: memory_pool.hpp:85
NodeT::DataType DataType
Definition: memory_pool.hpp:22
Definition: memory_pool.hpp:20
void deleteBlock(BlockT *block_ptr)
Delete a given block.
Definition: memory_pool.hpp:78
NodeT * allocateNode(const Eigen::Vector3i &node_coord, const unsigned int node_size)
Allocate a node using its coordinates and size.
Definition: memory_pool.hpp:33
BoostMemoryPool()
Definition: memory_pool.hpp:24
BlockT * allocateBlock(NodeT *parent_ptr, const int child_idx, const DataType init_data)
Allocate a block using its parent and child index.
Definition: memory_pool.hpp:61
boost::pool node_buffer_
The node buffer.
Definition: memory_pool.hpp:84
NodeT * allocateNode(NodeT *parent_ptr, const int child_idx, const DataType init_data)
Allocate a node using its parent and child index.
Definition: memory_pool.hpp:47
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17