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

Unified Diff: src/d8.cc

Issue 21369002: Speed-up 'new TypedArray(arrayLike)'. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: References -> pointers (argh!) Created 7 years, 5 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 | « include/v8.h ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 1efe2ae0b407958fc4b2e0632e7597f4ae215fe2..cde8404dcc29b914e5e4114c59f918b55892d914 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1562,7 +1562,14 @@ static void SetStandaloneFlagsViaCommandLine() {
class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
public:
- virtual void* Allocate(size_t length) { return malloc(length); }
+ virtual void* Allocate(size_t length) {
+ void* result = malloc(length);
+ memset(result, 0, length);
+ return result;
+ }
+ virtual void* AllocateUninitialized(size_t length) {
+ return malloc(length);
+ }
virtual void Free(void* data) { free(data); }
};
« no previous file with comments | « include/v8.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698