Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: src/runtime/runtime-typedarray.cc

Issue 1116633002: Pass ArrayBuffer::Allocator via Isolate::CreateParams (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-typedarray.cc
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc
index 26e37ac86f74a5333c93bca50c8a9c43dd374551..036ee41413d096a4382709ebb1349974e4b33a63 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -22,9 +22,9 @@ void Runtime::FreeArrayBuffer(Isolate* isolate,
reinterpret_cast<v8::Isolate*>(isolate)
->AdjustAmountOfExternalAllocatedMemory(
-static_cast<int64_t>(allocated_length));
- CHECK(V8::ArrayBufferAllocator() != NULL);
- V8::ArrayBufferAllocator()->Free(phantom_array_buffer->backing_store(),
- allocated_length);
+ CHECK(isolate->array_buffer_allocator() != NULL);
+ isolate->array_buffer_allocator()->Free(phantom_array_buffer->backing_store(),
+ allocated_length);
}
@@ -67,15 +67,15 @@ bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate,
size_t allocated_length,
bool initialize) {
void* data;
- CHECK(V8::ArrayBufferAllocator() != NULL);
+ CHECK(isolate->array_buffer_allocator() != NULL);
// Prevent creating array buffers when serializing.
DCHECK(!isolate->serializer_enabled());
if (allocated_length != 0) {
if (initialize) {
- data = V8::ArrayBufferAllocator()->Allocate(allocated_length);
+ data = isolate->array_buffer_allocator()->Allocate(allocated_length);
} else {
- data =
- V8::ArrayBufferAllocator()->AllocateUninitialized(allocated_length);
+ data = isolate->array_buffer_allocator()->AllocateUninitialized(
+ allocated_length);
}
if (data == NULL) return false;
} else {
@@ -173,7 +173,7 @@ RUNTIME_FUNCTION(Runtime_ArrayBufferNeuter) {
size_t byte_length = NumberToSize(isolate, array_buffer->byte_length());
array_buffer->set_is_external(true);
Runtime::NeuterArrayBuffer(array_buffer);
- V8::ArrayBufferAllocator()->Free(backing_store, byte_length);
+ isolate->array_buffer_allocator()->Free(backing_store, byte_length);
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/isolate.h ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698