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
17
18namespace ECS { namespace Memory { namespace Allocator {
19
21 {
22 private:
23
24 const size_t OBJECT_SIZE;
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__
#define ECS_API
Definition: Platform.h:16
uint8_t u8
Definition: Platform.h:49