diff options
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_memory.cpp | 9 | ||||
-rw-r--r-- | core/fxcrt/fx_memory.h | 6 | ||||
-rw-r--r-- | core/fxcrt/fx_memory_unittest.cpp | 8 |
3 files changed, 10 insertions, 13 deletions
diff --git a/core/fxcrt/fx_memory.cpp b/core/fxcrt/fx_memory.cpp index 6a592a12d2..6a135ae0f8 100644 --- a/core/fxcrt/fx_memory.cpp +++ b/core/fxcrt/fx_memory.cpp @@ -24,8 +24,7 @@ void FXMEM_InitializePartitionAlloc() { } } -// TODO(palmer): Remove the |flags| argument. -void* FXMEM_DefaultAlloc(size_t byte_size, int flags) { +void* FXMEM_DefaultAlloc(size_t byte_size) { return pdfium::base::PartitionAllocGenericFlags( gGeneralPartitionAllocator.root(), pdfium::base::PartitionAllocReturnNull, byte_size, "GeneralPartition"); @@ -35,14 +34,12 @@ void* FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size) { return FX_SafeAlloc(num_elems, byte_size); } -// TODO(palmer): Remove the |flags| argument. -void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags) { +void* FXMEM_DefaultRealloc(void* pointer, size_t new_size) { return pdfium::base::PartitionReallocGeneric( gGeneralPartitionAllocator.root(), pointer, new_size, "GeneralPartition"); } -// TODO(palmer): Remove the |flags| argument. -void FXMEM_DefaultFree(void* pointer, int flags) { +void FXMEM_DefaultFree(void* pointer) { pdfium::base::PartitionFree(pointer); } diff --git a/core/fxcrt/fx_memory.h b/core/fxcrt/fx_memory.h index f89095ad9c..ecf3e42655 100644 --- a/core/fxcrt/fx_memory.h +++ b/core/fxcrt/fx_memory.h @@ -14,10 +14,10 @@ extern "C" { #endif // For external C libraries to malloc through PDFium. These may return nullptr. -void* FXMEM_DefaultAlloc(size_t byte_size, int flags); +void* FXMEM_DefaultAlloc(size_t byte_size); 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); +void* FXMEM_DefaultRealloc(void* pointer, size_t new_size); +void FXMEM_DefaultFree(void* pointer); #ifdef __cplusplus } // extern "C" diff --git a/core/fxcrt/fx_memory_unittest.cpp b/core/fxcrt/fx_memory_unittest.cpp index ae15db2a72..2856bb9592 100644 --- a/core/fxcrt/fx_memory_unittest.cpp +++ b/core/fxcrt/fx_memory_unittest.cpp @@ -72,10 +72,10 @@ TEST(fxcrt, FX_TryAllocOverflow) { } TEST(fxcrt, DISABLED_FXMEM_DefaultOOM) { - EXPECT_FALSE(FXMEM_DefaultAlloc(kMaxByteAlloc, 0)); + EXPECT_FALSE(FXMEM_DefaultAlloc(kMaxByteAlloc)); - void* ptr = FXMEM_DefaultAlloc(1, 0); + void* ptr = FXMEM_DefaultAlloc(1); EXPECT_TRUE(ptr); - EXPECT_FALSE(FXMEM_DefaultRealloc(ptr, kMaxByteAlloc, 0)); - FXMEM_DefaultFree(ptr, 0); + EXPECT_FALSE(FXMEM_DefaultRealloc(ptr, kMaxByteAlloc)); + FXMEM_DefaultFree(ptr); } |