From f6c67325ebb931ecad6c0f0e90302d854db75900 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 13 Oct 2015 12:11:15 -0700 Subject: Merge to XFA: wstring allocations waste up to 7 wasted bytes. Original Review URL: https://codereview.chromium.org/1399983003 . (cherry picked from commit 6eeffab789800e2afa1b9d10de70c9116db32355) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1399893003 . --- core/src/fxcrt/fx_basic_wstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index e7f8c01d41..c097e1fc09 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -32,7 +32,7 @@ CFX_WideString::StringData* CFX_WideString::StringData::Create(int nLen) { int usableLen = (totalSize - overhead) / sizeof(FX_WCHAR); FXSYS_assert(usableLen >= nLen); - void* pData = FX_Alloc(uint8_t, iSize.ValueOrDie()); + void* pData = FX_Alloc(uint8_t, totalSize); return new (pData) StringData(nLen, usableLen); } CFX_WideString::~CFX_WideString() { -- cgit v1.2.3