Sources Pipelines Documentation

Allocators  
null_allocator.ipp
1 // Copyright (c) 2016 Lukasz Laszko
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #pragma once
6 
7 
8 namespace boost { namespace memory {
9 
10 inline memory_block null_allocator::allocate(std::size_t size)
11 {
12  return null_block;
13 }
14 
16 {
17  block.address = nullptr;
18  block.size = 0ul;
19 }
20 
22 {
23  return block.address == nullptr;
24 }
25 
26 } }
27 
void deallocate(memory_block &block)
bool owns(memory_block &block)
Checks if the given block is owned by this allocator.
std::size_t size
Block's size.
Represents an allocated memory block.
memory_block allocate(std::size_t size=0)