summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_memmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_basic_memmgr.cpp')
-rw-r--r--core/fxcrt/fx_basic_memmgr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fxcrt/fx_basic_memmgr.cpp b/core/fxcrt/fx_basic_memmgr.cpp
index 06568c04ad..f3aaa3678d 100644
--- a/core/fxcrt/fx_basic_memmgr.cpp
+++ b/core/fxcrt/fx_basic_memmgr.cpp
@@ -11,6 +11,16 @@
pdfium::base::PartitionAllocatorGeneric gArrayBufferPartitionAllocator;
pdfium::base::PartitionAllocatorGeneric gStringPartitionAllocator;
+void FXMEM_InitalizePartitionAlloc() {
+ static bool s_gPartitionAllocatorsInitialized = false;
+ if (!s_gPartitionAllocatorsInitialized) {
+ pdfium::base::PartitionAllocGlobalInit(FX_OutOfMemoryTerminate);
+ gArrayBufferPartitionAllocator.init();
+ gStringPartitionAllocator.init();
+ s_gPartitionAllocatorsInitialized = true;
+ }
+}
+
void* FXMEM_DefaultAlloc(size_t byte_size, int flags) {
return (void*)malloc(byte_size);
}