Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: core/src/fxcrt/fx_basic_memmgr.cpp

Issue 1757043002: Remove unused CFX_GrowOnlyPool. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_memory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_memmgr.cpp
diff --git a/core/src/fxcrt/fx_basic_memmgr.cpp b/core/src/fxcrt/fx_basic_memmgr.cpp
index 6665df60dac9cfe0d19c75eb70f47a647da7b32c..a0af6aef6d7a4aab0566008a0feb0e9bf8440482 100644
--- a/core/src/fxcrt/fx_basic_memmgr.cpp
+++ b/core/src/fxcrt/fx_basic_memmgr.cpp
@@ -23,45 +23,3 @@ NEVER_INLINE void FX_OutOfMemoryTerminate() {
abort();
reinterpret_cast<void (*)()>(0xbd)();
}
-
-CFX_GrowOnlyPool::CFX_GrowOnlyPool(size_t trunk_size) {
- m_TrunkSize = trunk_size;
- m_pFirstTrunk = NULL;
-}
-CFX_GrowOnlyPool::~CFX_GrowOnlyPool() {
- FreeAll();
-}
-struct _FX_GrowOnlyTrunk {
- size_t m_Size;
- size_t m_Allocated;
- _FX_GrowOnlyTrunk* m_pNext;
-};
-void CFX_GrowOnlyPool::FreeAll() {
- _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- while (pTrunk) {
- _FX_GrowOnlyTrunk* pNext = pTrunk->m_pNext;
- FX_Free(pTrunk);
- pTrunk = pNext;
- }
- m_pFirstTrunk = NULL;
-}
-void* CFX_GrowOnlyPool::Alloc(size_t size) {
- size = (size + 3) / 4 * 4;
- _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- while (pTrunk) {
- if (pTrunk->m_Size - pTrunk->m_Allocated >= size) {
- void* p = (uint8_t*)(pTrunk + 1) + pTrunk->m_Allocated;
- pTrunk->m_Allocated += size;
- return p;
- }
- pTrunk = pTrunk->m_pNext;
- }
- size_t alloc_size = size > m_TrunkSize ? size : m_TrunkSize;
- pTrunk = (_FX_GrowOnlyTrunk*)FX_Alloc(uint8_t,
- sizeof(_FX_GrowOnlyTrunk) + alloc_size);
- pTrunk->m_Size = alloc_size;
- pTrunk->m_Allocated = size;
- pTrunk->m_pNext = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- m_pFirstTrunk = pTrunk;
- return pTrunk + 1;
-}
« no previous file with comments | « core/include/fxcrt/fx_memory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698