2
3
4
5
10#include "Core/Container/FreeList.h"
15
16
17
23
24
28
29
33
34
35
39
40
41
45
46
47
48
52
53
54
55
61
62
63
64
65
69
70
71
72
73
79
80
85
86
92
93
97
98
102
103
104
110
111
static void Free(void *ptr)
Free memory entry point.
static void *& PointerSpace(void *obj)
Get object first 4/8 bytes as a pointer.
scl::span * MapObjectToSpan(void *obj) const
Find span by memory pointer.
static PageCache * Get()
Get this single instance.
void ReleaseSpanToPageCache(scl::span *s)
Release span from cc to pc,.
Page memory cache. Third level of memory allocator.
virtual ~ThreadCacheThreadWapper()
Destructor Function.
ThreadCache * instance
This thread ThreadCache instance.
ThreadCacheThreadWapper()
Constructor Function.
static ThreadCache *& GetInst()
Get ThreadCache Instance. @reutrn Returns ThreadCache Instance.
Wapper of Instance/Delete ThreadCache in thread.
void Deallocate(void *obj, size_t size)
Recycle object memory.
ThreadCache & operator=(const ThreadCache &)=delete
Copy Assignment Operation.
void * FetchFromCentralCache(size_t index, size_t alignSize)
Fetch memory from central cache if this is run out.
std::array< scl::free_list, MemoryPool::FREE_LIST_NUM > m_FreeLists
FreeList Array.
static void ReleaseToCentralCache(scl::free_list &list, size_t size, size_t count)
Release memory to cc.
virtual ~ThreadCache()
Destructor Function.
ThreadCache(const ThreadCache &)=delete
Copy Constructor Function.
void * Allocate(size_t size)
Allocate memory.
ThreadCache()=default
Constructor Function.
Thread memory cache. First level of memory allocator.
Free list for memory pool.
bool m_IsUse
True if in use.
Used for manage multiple page memory.