Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: core/src/fxcrt/fx_basic_wstring.cpp

Issue 1399983003: wstring allocations waste up to 7 wasted bytes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_wstring.cpp
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index e7f8c01d416fad17971cfd3eebe6002fe82f0f99..c097e1fc0923fcc3cec68cd7b254fb27029b8f17 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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698