diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-16 20:24:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-16 20:24:19 +0000 |
commit | 994576bc0f3e7f33fece1fc8f20fd85ae1419b21 (patch) | |
tree | 1cb43088d7e2b8f5393f4aecab3cb7af2e5b3db5 /fxjs | |
parent | f1fae3cd1b9492cf9411dffd3c486b9672d8cc76 (diff) | |
download | pdfium-994576bc0f3e7f33fece1fc8f20fd85ae1419b21.tar.xz |
Use PartitionAllocZeroFill in CFX_V8ArrayBufferAllocator::Allocate().
Avoid a manual memset().
BUG=pdfium:1171
Change-Id: Ib624906c6852966bce90b8c877ce45079bc6810e
Reviewed-on: https://pdfium-review.googlesource.com/c/44074
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 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fxjs/cfx_v8.cpp b/fxjs/cfx_v8.cpp index 26c9a43988..4d12e3353e 100644 --- a/fxjs/cfx_v8.cpp +++ b/fxjs/cfx_v8.cpp @@ -206,10 +206,8 @@ v8::Local<v8::Array> CFX_V8::ToArray(v8::Local<v8::Value> pValue) { void* CFX_V8ArrayBufferAllocator::Allocate(size_t length) { if (length > kMaxAllowedBytes) return nullptr; - void* p = AllocateUninitialized(length); - if (p) - memset(p, 0, length); - return p; + return gArrayBufferPartitionAllocator.root()->AllocFlags( + pdfium::base::PartitionAllocZeroFill, length, "CFX_V8ArrayBuffer"); } void* CFX_V8ArrayBufferAllocator::AllocateUninitialized(size_t length) { |