summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxcodec/codec/ccodec_tiffmodule.cpp4
-rw-r--r--core/fxcrt/fx_basic_memmgr.cpp6
-rw-r--r--core/fxcrt/fx_memory.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp
index 295f0abe34..3c24c33286 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
+++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
@@ -62,6 +62,10 @@ class CCodec_TiffContext {
TIFF* m_tif_ctx;
};
+void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz) {
+ return FXMEM_DefaultCalloc(nmemb, siz);
+}
+
void* _TIFFmalloc(tmsize_t size) {
return FXMEM_DefaultAlloc(size, 0);
}
diff --git a/core/fxcrt/fx_basic_memmgr.cpp b/core/fxcrt/fx_basic_memmgr.cpp
index f3aaa3678d..75bc2bc1f1 100644
--- a/core/fxcrt/fx_basic_memmgr.cpp
+++ b/core/fxcrt/fx_basic_memmgr.cpp
@@ -24,9 +24,15 @@ void FXMEM_InitalizePartitionAlloc() {
void* FXMEM_DefaultAlloc(size_t byte_size, int flags) {
return (void*)malloc(byte_size);
}
+
+void* FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size) {
+ return calloc(num_elems, byte_size);
+}
+
void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags) {
return realloc(pointer, new_size);
}
+
void FXMEM_DefaultFree(void* pointer, int flags) {
free(pointer);
}
diff --git a/core/fxcrt/fx_memory.h b/core/fxcrt/fx_memory.h
index eb369d7d6c..684f2f2646 100644
--- a/core/fxcrt/fx_memory.h
+++ b/core/fxcrt/fx_memory.h
@@ -15,6 +15,7 @@ extern "C" {
// For external C libraries to malloc through PDFium. These may return nullptr.
void* FXMEM_DefaultAlloc(size_t byte_size, int flags);
+void* FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size);
void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags);
void FXMEM_DefaultFree(void* pointer, int flags);