Commit 7efb8e42 authored by Chase Phillips's avatar Chase Phillips Committed by Commit Bot

Calculate size of new data in SetData() for GC accounting

The previous code was using data_->size() for both
|external_allocated_size_| and |old_external_allocated_size|,
which would lead to AdjustAmountOfExternalAllocatedMemory()
always being passed 0.

Bug: None
Change-Id: If50fbc029124237849121aa56b49093e0890ec85
Reviewed-on: https://chromium-review.googlesource.com/1180467
Commit-Queue: Chase Phillips <cmp@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584262}
parent 043dcce7
......@@ -86,7 +86,7 @@ void IDBValue::SetData(scoped_refptr<SharedBuffer> new_data) {
DCHECK(new_data) << "Value unwrapping must result in a non-empty buffer";
int64_t old_external_allocated_size = external_allocated_size_;
external_allocated_size_ = data_->size();
external_allocated_size_ = new_data->size();
isolate_->AdjustAmountOfExternalAllocatedMemory(external_allocated_size_ -
old_external_allocated_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment