Sources Pipelines Documentation

Allocators  
memory_block.hpp
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 #include <cstddef>
8 #include <cstdint>
9 
10 
11 namespace boost { namespace memory {
12 
21 {
25  void* address;
26 
30  std::size_t size;
31 
37  inline operator std::uint8_t* () const
38  {
39  return reinterpret_cast<std::uint8_t*>(address);
40  }
41 
48  inline bool operator==(const memory_block& other) const
49  {
50  return address == other.address && size == other.size;
51  }
52 };
53 
61 static const memory_block null_block = { nullptr, 0ul };
62 
63 } }
64 
std::size_t size
Block&#39;s size.
Represents an allocated memory block.
bool operator==(const memory_block &other) const
Checks if memory blocks are identical.