diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-17 16:42:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-17 16:42:32 +0000 |
commit | 23b2d61fdd1f78679c6bb375bb9dde666cf7cc3f (patch) | |
tree | 338a25867fd14bbd9e6b45137a9095bfc661cead /fxjs | |
parent | a358d622339d022e3723525141900365caf55ca1 (diff) | |
download | pdfium-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 'fxjs')
-rw-r--r-- | fxjs/cfx_v8.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fxjs/cfx_v8.cpp b/fxjs/cfx_v8.cpp index 4d12e3353e..73d95ae9b4 100644 --- a/fxjs/cfx_v8.cpp +++ b/fxjs/cfx_v8.cpp @@ -206,17 +206,17 @@ v8::Local<v8::Array> CFX_V8::ToArray(v8::Local<v8::Value> pValue) { void* CFX_V8ArrayBufferAllocator::Allocate(size_t length) { if (length > kMaxAllowedBytes) return nullptr; - return gArrayBufferPartitionAllocator.root()->AllocFlags( + return GetArrayBufferPartitionAllocator().root()->AllocFlags( pdfium::base::PartitionAllocZeroFill, length, "CFX_V8ArrayBuffer"); } void* CFX_V8ArrayBufferAllocator::AllocateUninitialized(size_t length) { if (length > kMaxAllowedBytes) return nullptr; - return gArrayBufferPartitionAllocator.root()->Alloc(length, - "CFX_V8ArrayBuffer"); + return GetArrayBufferPartitionAllocator().root()->Alloc(length, + "CFX_V8ArrayBuffer"); } void CFX_V8ArrayBufferAllocator::Free(void* data, size_t length) { - gArrayBufferPartitionAllocator.root()->Free(data); + GetArrayBufferPartitionAllocator().root()->Free(data); } |