Lugdunum
0.1.0
include
lug
System
Memory
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
10
class
LUG_SYSTEM_API
FreeList
{
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
:
29
struct
LUG_SYSTEM_API
Element
{
30
Element
*
next
;
31
};
32
33
size_t
_size
;
34
Element
* _nextFree{
nullptr
};
35
};
36
37
}
// Memory
38
}
// System
39
}
// lug
lug::System::Memory::FreeList::Element
Definition:
FreeList.hpp:29
Export.hpp
LUG_SYSTEM_API
#define LUG_SYSTEM_API
Definition:
Export.hpp:11
lug::System::Memory::FreeList::_size
size_t _size
Definition:
FreeList.hpp:33
lug::System::Memory::FreeList
Definition:
FreeList.hpp:10
lug
Definition:
Application.hpp:11
lug::System::Memory::FreeList::Element::next
Element * next
Definition:
FreeList.hpp:30
Generated by
1.8.13