Lugdunum  0.1.0
FreeList.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdlib>
4 #include <lug/System/Export.hpp>
5 
6 namespace lug {
7 namespace System {
8 namespace Memory {
9 
11 public:
12  explicit FreeList(size_t size);
13 
14  FreeList(const FreeList&) = default;
15  FreeList(FreeList&&) = default;
16 
17  FreeList& operator=(const FreeList&) = default;
18  FreeList& operator=(FreeList&&) = default;
19 
20  ~FreeList() = default;
21 
22  bool grow(void* start, void* end, size_t alignment, size_t offset);
23 
24  void* allocate();
25  void free(void* ptr);
26  void reset();
27 
28 private:
31  };
32 
33  size_t _size;
34  Element* _nextFree{nullptr};
35 };
36 
37 } // Memory
38 } // System
39 } // lug
#define LUG_SYSTEM_API
Definition: Export.hpp:11