From e4b035b722ad69d4a4357c54cd3c9f1f8574b067 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Sun, 26 Mar 2017 15:48:34 -0700 Subject: Use PartitionAlloc for JavaScript ArrayBuffers and strings. BUG=pdfium:681 Change-Id: I5073d80d9bd623b73e578d5ba2226c39c371bab0 Reviewed-on: https://pdfium-review.googlesource.com/3097 Commit-Queue: Chris Palmer Reviewed-by: Tom Sepez --- core/fxcrt/cfx_string_data_template.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxcrt/cfx_string_data_template.h') diff --git a/core/fxcrt/cfx_string_data_template.h b/core/fxcrt/cfx_string_data_template.h index 2e87a811a5..33013fde33 100644 --- a/core/fxcrt/cfx_string_data_template.h +++ b/core/fxcrt/cfx_string_data_template.h @@ -35,7 +35,8 @@ class CFX_StringDataTemplate { int usableLen = (totalSize - overhead) / sizeof(CharType); ASSERT(usableLen >= nLen); - void* pData = FX_Alloc(uint8_t, totalSize); + void* pData = pdfium::base::PartitionAllocGeneric( + gStringPartitionAllocator.root(), totalSize, "CFX_StringDataTemplate"); return new (pData) CFX_StringDataTemplate(nLen, usableLen); } @@ -54,7 +55,7 @@ class CFX_StringDataTemplate { void Retain() { ++m_nRefs; } void Release() { if (--m_nRefs <= 0) - FX_Free(this); + pdfium::base::PartitionFree(this); } bool CanOperateInPlace(FX_STRSIZE nTotalLen) const { -- cgit v1.2.3