Index: test/cctest/cctest.cc |
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc |
index 08fb01bc291860c01071bafd35f11b00ae01afd5..b8c77fcb8d1c4deba40a11caf02a10a0b982006b 100644 |
--- a/test/cctest/cctest.cc |
+++ b/test/cctest/cctest.cc |
@@ -141,6 +141,14 @@ class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
}; |
+class CcTestSharedArrayBufferAllocator |
+ : public v8::SharedArrayBuffer::Allocator { |
+ virtual void* Allocate(size_t length) { return malloc(length); } |
+ virtual void* AllocateUninitialized(size_t length) { return malloc(length); } |
+ virtual void Free(void* data, size_t length) { free(data); } |
+}; |
+ |
+ |
static void SuggestTestHarness(int tests) { |
if (tests == 0) return; |
printf("Running multiple tests in sequence is deprecated and may cause " |
@@ -177,6 +185,9 @@ int main(int argc, char* argv[]) { |
CcTestArrayBufferAllocator array_buffer_allocator; |
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
+ CcTestSharedArrayBufferAllocator shared_array_buffer_allocator; |
+ v8::V8::SetSharedArrayBufferAllocator(&shared_array_buffer_allocator); |
+ |
i::PrintExtension print_extension; |
v8::RegisterExtension(&print_extension); |
i::ProfilerExtension profiler_extension; |