8 namespace boost {
namespace memory {
11 std::size_t threshold,
12 typename primary_allocator,
13 typename secondary_allocator>
14 inline memory_block segregator<
17 secondary_allocator>::allocate(std::size_t size)
19 if (size <= threshold)
20 return primary_.allocate(size);
22 return secondary_.allocate(size);
26 std::size_t threshold,
27 typename primary_allocator,
28 typename secondary_allocator>
34 if (block.
size <= threshold)
37 secondary_.deallocate(block);
41 std::size_t threshold,
42 typename primary_allocator,
43 typename secondary_allocator>
49 return block.
size <= threshold ? primary_.owns(block) : secondary_.owns(block);
53 std::size_t threshold,
54 typename primary_allocator,
55 typename secondary_allocator>
59 secondary_allocator>::get_primary() noexcept
65 std::size_t threshold,
66 typename primary_allocator,
67 typename secondary_allocator>
71 secondary_allocator>::get_secondary() noexcept
void deallocate(memory_block &block)
Deallocates the given memory_block if possible.
std::size_t size
Block's size.
Represents an allocated memory block.
Segregates allocation strategies according to the given allocation size threshold.