summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-12 13:46:38 -0700
committerTom Sepez <tsepez@chromium.org>2015-03-12 13:46:38 -0700
commitb8cd18a4ab6d408f061ba3255a46882dbbf071f8 (patch)
tree5bd53ba91d6986c216880153cda60495ac4eec12 /core/include
parent090d683489bfa3f36f1e2624c310ff9ca5836038 (diff)
downloadpdfium-b8cd18a4ab6d408f061ba3255a46882dbbf071f8.tar.xz
Revert "Kill CFX_GrowOnlyPool."
This reverts commit 090d683489bfa3f36f1e2624c310ff9ca5836038. Symbol appears in files that are not compiled anywhere, it would seem. Reverting to remove these first. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1001023003
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fxcrt/fx_memory.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h
index 8806bba7dd..cb71c04fca 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