Commit 59dd9f26 authored by Austin Eng's avatar Austin Eng Committed by Commit Bot

Update GPUBuffer mapping to use v8::BackingStore::EmptyDeleter

Mapped GPUBuffers' memory is owned and externally managed by dawn_wire.
Using EmptyDeleter tells the backing store this allocation does not
hold memory and will not increase GC pressure.

Bug: 1061960
Change-Id: Ia44a5dc1be89d7b55540247c90bce614172fa2ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380086
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: default avatarKai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802866}
parent a4ac6cb7
...@@ -303,10 +303,7 @@ DOMArrayBuffer* GPUBuffer::CreateArrayBufferForMappedData(void* data, ...@@ -303,10 +303,7 @@ DOMArrayBuffer* GPUBuffer::CreateArrayBufferForMappedData(void* data,
DCHECK_LE(data_length, kLargestMappableSize); DCHECK_LE(data_length, kLargestMappableSize);
ArrayBufferContents contents(data, data_length, ArrayBufferContents contents(data, data_length,
[](void* data, size_t length, void* info) { v8::BackingStore::EmptyDeleter);
// DataDeleter does nothing because Dawn wire
// owns the memory.
});
DOMArrayBuffer* array_buffer = DOMArrayBuffer::Create(contents); DOMArrayBuffer* array_buffer = DOMArrayBuffer::Create(contents);
mapped_array_buffers_.push_back(array_buffer); mapped_array_buffers_.push_back(array_buffer);
......
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