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

Unified Diff: core/include/fxcrt/fx_memory.h

Issue 1001023003: Revert "Kill CFX_GrowOnlyPool." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | core/src/fxcrt/fx_basic_memmgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_memory.h
diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h
index 8806bba7dde6ede6336b91c480efe11e9f63318a..cb71c04fcaf9e72789fed460d44664e692e9c890 100644
--- a/core/include/fxcrt/fx_memory.h
+++ b/core/include/fxcrt/fx_memory.h
@@ -65,9 +65,12 @@ public:
}
void operator delete (void*, void*) {}
};
+#endif
+#ifdef __cplusplus
#if defined(_DEBUG)
#define FX_NEW new(__FILE__, __LINE__)
#else
+
#define FX_NEW new
#endif
#define FX_NEW_VECTOR(Pointer, Class, Count) \
@@ -88,5 +91,44 @@ public:
virtual ~CFX_DestructObject() {}
};
-#endif // __cplusplus
-#endif // _FX_MEMORY_H_
+class CFX_GrowOnlyPool : public CFX_Object
+{
+public:
+
+ CFX_GrowOnlyPool(size_t trunk_size = 16384);
+
+ ~CFX_GrowOnlyPool();
+
+ void SetTrunkSize(size_t trunk_size)
+ {
+ m_TrunkSize = trunk_size;
+ }
+
+ void* AllocDebug(size_t size, FX_LPCSTR file, int line)
+ {
+ return Alloc(size);
+ }
+
+ void* Alloc(size_t size);
+
+ void* ReallocDebug(void* p, size_t new_size, FX_LPCSTR file, int line)
+ {
+ return NULL;
+ }
+
+ void* Realloc(void* p, size_t new_size)
+ {
+ return NULL;
+ }
+
+ void Free(void*) {}
+
+ void FreeAll();
+private:
+
+ size_t m_TrunkSize;
+
+ void* m_pFirstTrunk;
+};
+#endif
+#endif
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_memmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698