lintel 0.2.0
Loading...
Searching...
No Matches
BoostSegmentAllocator.h
Go to the documentation of this file.
1#ifndef LINTEL_BOOSTSEGMENTALLOCATOR_H
2#define LINTEL_BOOSTSEGMENTALLOCATOR_H
3
4#include <boost/interprocess/managed_mapped_file.hpp>
5
7
8namespace lintel {
19{
20public:
22 explicit BoostSegmentAllocator(boost::interprocess::managed_mapped_file::segment_manager &segment)
23 : m_segment(&segment)
24 {}
25
26 void *allocate(std::size_t bytes) override { return m_segment->allocate(bytes); }
27
28 void deallocate(void *pointer) override { m_segment->deallocate(pointer); }
29
30private:
31 boost::interprocess::managed_mapped_file::segment_manager *m_segment;
32};
33
34}// namespace lintel
35#endif// LINTEL_BOOSTSEGMENTALLOCATOR_H
Definition BoostSegmentAllocator.h:19
void * allocate(std::size_t bytes) override
Definition BoostSegmentAllocator.h:26
BoostSegmentAllocator(boost::interprocess::managed_mapped_file::segment_manager &segment)
Definition BoostSegmentAllocator.h:22
void deallocate(void *pointer) override
Definition BoostSegmentAllocator.h:28
Definition ShmSegmentAccessor.h:25
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9