summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_memory.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-13 15:26:36 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-13 20:12:54 +0000
commit3e5ef465d294d26829b95e59e945ff4255f96abd (patch)
tree2ac737b88674b91c8e692a5eb33d71b996467bec /core/fxcrt/fx_memory.cpp
parent38a01b9ceeddbbc73fb1167d30c5aa6994328949 (diff)
downloadpdfium-3e5ef465d294d26829b95e59e945ff4255f96abd.tar.xz
Use PartitionAlloc with PartitionAllocReturnNull
This CL changes usage of PartitionAlloc in fx_memory to allow null return value for methods used by external C libraries. Change-Id: I8e2b5dcfb37e30370606afb9a71a7a1d3a28c097 Reviewed-on: https://pdfium-review.googlesource.com/7770 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_memory.cpp')
-rw-r--r--core/fxcrt/fx_memory.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fxcrt/fx_memory.cpp b/core/fxcrt/fx_memory.cpp
index 589a4cf508..6a592a12d2 100644
--- a/core/fxcrt/fx_memory.cpp
+++ b/core/fxcrt/fx_memory.cpp
@@ -26,8 +26,9 @@ void FXMEM_InitializePartitionAlloc() {
// TODO(palmer): Remove the |flags| argument.
void* FXMEM_DefaultAlloc(size_t byte_size, int flags) {
- return pdfium::base::PartitionAllocGeneric(gGeneralPartitionAllocator.root(),
- byte_size, "GeneralPartition");
+ return pdfium::base::PartitionAllocGenericFlags(
+ gGeneralPartitionAllocator.root(), pdfium::base::PartitionAllocReturnNull,
+ byte_size, "GeneralPartition");
}
void* FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size) {