2
3
4
5
10#include "Core/Container/SpanList.h"
15
16
17
23
24
28
29
33
34
35
39
40
41
45
46
47
51
52
53
54
55
56
57
61
62
63
64
70
71
72
73
74
80
81
85
86
CentralCache()=default
Constructor Function.
static scl::span * GetOneSpan(scl::span_list &list, size_t size)
Get a not empty span.
size_t FetchRange(void *&start, void *&end, size_t batchNum, size_t size)
Fetch range memory to tc.
static CentralCache m_CentralCache
Single instance of this.
CentralCache & operator=(const CentralCache &)=delete
Copy Assignment Operation.
virtual ~CentralCache()=default
Destructor Function.
void ReleaseListToSpans(void *start, size_t size)
Release memory to pc.
std::array< scl::span_list, MemoryPool::FREE_LIST_NUM > m_SpanLists
FreeList Array.
CentralCache(const CentralCache &)=delete
Copy Constructor Function.
static CentralCache * Get()
Get this single Instance.
Central memory cache. Second level of memory allocator.
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.
void PushFront(span *s)
Push a span to this list.
span * Begin() const
Get begin pointer.
span * End() const
Get end pointer.
Bidirectional cyclic linked list for span.
void * m_FreeList
current pointer.
bool m_IsUse
True if in use.
Used for manage multiple page memory.