summaryrefslogtreecommitdiff
path: root/core/fxcrt/string_data_template.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-17 16:42:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-17 16:42:32 +0000
commit23b2d61fdd1f78679c6bb375bb9dde666cf7cc3f (patch)
tree338a25867fd14bbd9e6b45137a9095bfc661cead /core/fxcrt/string_data_template.h
parenta358d622339d022e3723525141900365caf55ca1 (diff)
downloadpdfium-23b2d61fdd1f78679c6bb375bb9dde666cf7cc3f.tar.xz
Fix the static initialization order problem for PartitionAlloc.
Inside fx_memory.cpp, the PartitionAllocatorGeneric objects are globals, so their initialization order is not well defined. BUG=chromium:896117 Change-Id: If4a345d6d7549b0e99a055859eaa67d5ec32c788 Reviewed-on: https://pdfium-review.googlesource.com/c/44170 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/string_data_template.h')
-rw-r--r--core/fxcrt/string_data_template.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcrt/string_data_template.h b/core/fxcrt/string_data_template.h
index 0fe679d243..656d3501e1 100644
--- a/core/fxcrt/string_data_template.h
+++ b/core/fxcrt/string_data_template.h
@@ -36,8 +36,8 @@ class StringDataTemplate {
size_t usableLen = (totalSize - overhead) / sizeof(CharType);
ASSERT(usableLen >= nLen);
- void* pData = gStringPartitionAllocator.root()->Alloc(totalSize,
- "StringDataTemplate");
+ void* pData = GetStringPartitionAllocator().root()->Alloc(
+ totalSize, "StringDataTemplate");
return new (pData) StringDataTemplate(nLen, usableLen);
}
@@ -50,7 +50,7 @@ class StringDataTemplate {
void Retain() { ++m_nRefs; }
void Release() {
if (--m_nRefs <= 0)
- gStringPartitionAllocator.root()->Free(this);
+ GetStringPartitionAllocator().root()->Free(this);
}
bool CanOperateInPlace(size_t nTotalLen) const {