SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Free()

void Spices::MemoryPool::Free ( void * ptr)
static

Free memory entry point.

Parameters
[in]ptrmemory pointer.

release from pc.

release from tc.

release from pc.

release from tc.

Definition at line 42 of file MemoryPool.cpp.

43 {
44 assert(ptr);
45
47
48 if (!s)
49 {
50 free(ptr);
51 return;
52 }
53
54 const size_t size = s->m_BlockSize;
55
59 if (size > MAX_BYTES)
60 {
62 }
63
67 else
68 {
70 }
71 }
static constexpr size_t MAX_BYTES
Only allowed 256KB allocated memory one time in tc.
Definition MemoryPool.h:34
scl::span * MapObjectToSpan(void *obj) const
Find span by memory pointer.
Definition PageCache.cpp:21
static PageCache * Get()
Get this single instance.
Definition PageCache.h:50
void ReleaseSpanToPageCache(scl::span *s)
Release span from cc to pc,.
Definition PageCache.cpp:43
static ThreadCache *& GetInst()
Get ThreadCache Instance. @reutrn Returns ThreadCache Instance.
void Deallocate(void *obj, size_t size)
Recycle object memory.
size_t m_BlockSize
page block size.
Definition SpanList.h:66
Used for manage multiple page memory.
Definition SpanList.h:15

References Spices::PageCache::Get(), Spices::PageCache::MapObjectToSpan(), and Spices::PageCache::ReleaseSpanToPageCache().

Referenced by Spices::MemoryEntry::freeToPool(), SpicesTest::TEST_F(), SpicesTest::TEST_F(), SpicesTest::TEST_F(), and SpicesTest::TEST_F().