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

Unified Diff: test/unittests/run-all-unittests.cc

Issue 1110603005: Remove support for malloc'd typed arrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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/snapshot/mksnapshot.cc ('k') | tools/parser-shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/run-all-unittests.cc
diff --git a/test/unittests/run-all-unittests.cc b/test/unittests/run-all-unittests.cc
index 08d265624bf84eff360c99e4d88cb8c5ef9410ba..9c67cfaba59e920c7a9ce4b1d433999392ba14c2 100644
--- a/test/unittests/run-all-unittests.cc
+++ b/test/unittests/run-all-unittests.cc
@@ -13,6 +13,16 @@
namespace {
+class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
+ public:
+ virtual void* Allocate(size_t length) {
+ void* data = AllocateUninitialized(length);
+ return data == NULL ? data : memset(data, 0, length);
+ }
+ virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
+ virtual void Free(void* data, size_t) { free(data); }
+};
+
class DefaultPlatformEnvironment final : public ::testing::Environment {
public:
DefaultPlatformEnvironment() : platform_(NULL) {}
@@ -23,6 +33,7 @@ class DefaultPlatformEnvironment final : public ::testing::Environment {
platform_ = v8::platform::CreateDefaultPlatform();
ASSERT_TRUE(platform_ != NULL);
v8::V8::InitializePlatform(platform_);
+ v8::V8::SetArrayBufferAllocator(&array_buffer_allocator_);
ASSERT_TRUE(v8::V8::Initialize());
}
@@ -36,6 +47,7 @@ class DefaultPlatformEnvironment final : public ::testing::Environment {
private:
v8::Platform* platform_;
+ ArrayBufferAllocator array_buffer_allocator_;
};
} // namespace
« no previous file with comments | « src/snapshot/mksnapshot.cc ('k') | tools/parser-shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698