Allocator Builder
Policy Based C++ Template Allocator Library
 All Classes Functions Variables Enumerations Enumerator Groups Pages
null_allocator.hpp
1 //
3 // Copyright 2015 Felix Petriconi
4 //
5 // License: http://boost.org/LICENSE_1_0.txt, Boost License 1.0
6 //
7 // Authors: http://petriconi.net, Felix Petriconi
8 //
10 
11 #pragma once
12 #include "allocator_base.hpp"
13 
14 #include <cassert>
15 
16 namespace alb
17 {
18  inline namespace v_100
19  {
21  {
22  public:
23  static const unsigned alignment = 64 * 1024;
24 
25  block allocate(size_t) noexcept {
26  return {nullptr, 0};
27  }
28 
29  bool owns(const block& b) noexcept {
30  return !b;
31  }
32 
33  bool expand(block& b, size_t) noexcept {
34  assert(!b);
35  return false;
36  }
37 
38  bool reallocate(block& b, size_t) noexcept {
39  assert(!b);
40  return false;
41  }
42 
43  void deallocate(block& b) noexcept {
44  assert(!b);
45  }
46 
47  void deallocateAll() noexcept {
48  }
49  };
50  }
51  using namespace v_100;
52 }