Divide Framework
0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
PoolAllocator.h
Go to the documentation of this file.
1
/*
2
Author : Tobias Stein
3
Date : 22nd October, 2016
4
File : PoolAllocator.h
5
6
Pool allocator.
7
8
All Rights Reserved. (c) Copyright 2016.
9
*/
10
11
#pragma once
12
#ifndef ECS__POOL_ALLOC_H__
13
#define ECS__POOL_ALLOC_H__
14
15
16
#include "
Memory/Allocator/IAllocator.h
"
17
18
namespace
ECS
{
namespace
Memory {
namespace
Allocator {
19
20
class
ECS_API
PoolAllocator
:
public
IAllocator
21
{
22
private
:
23
24
const
size_t
OBJECT_SIZE
;
25
const
u8
OBJECT_ALIGNMENT
;
26
27
void
**
freeList
;
28
29
public
:
30
31
PoolAllocator
(
size_t
memSize,
const
void
* mem,
size_t
objectSize,
u8
objectAlignment);
32
33
virtual
~PoolAllocator
();
34
35
virtual
void
* allocate(
size_t
size,
u8
alignment)
override
;
36
virtual
void
free(
void
* p)
override
;
37
virtual
void
clear()
override
;
38
39
};
// class StackAllocator
40
41
}}}
// namespace ECS::Memory::Allocator
42
43
#endif
// ECS__POOL_ALLOC_H__
IAllocator.h
ECS_API
#define ECS_API
Definition:
Platform.h:16
ECS::Memory::Allocator::IAllocator
Definition:
IAllocator.h:56
ECS::Memory::Allocator::PoolAllocator
Definition:
PoolAllocator.h:21
ECS::Memory::Allocator::PoolAllocator::OBJECT_SIZE
const size_t OBJECT_SIZE
Definition:
PoolAllocator.h:24
ECS::Memory::Allocator::PoolAllocator::OBJECT_ALIGNMENT
const u8 OBJECT_ALIGNMENT
Definition:
PoolAllocator.h:25
ECS::Memory::Allocator::PoolAllocator::freeList
void ** freeList
Definition:
PoolAllocator.h:27
ECS
Definition:
SGNComponent.h:51
ECS::u8
uint8_t u8
Definition:
Platform.h:49
Source
ThirdParty
EntityComponentSystem
include
ECS
Memory
Allocator
PoolAllocator.h
Generated on Fri May 17 2024 16:59:57 for Divide Framework by
1.9.6