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

Unified Diff: include/v8.h

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 | « no previous file | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 6b1815383314046ef429acc68dd43c6c7a489335..50019497f8eae6174c40831297ef0100af4c8ba2 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2410,8 +2410,20 @@ class V8EXPORT ArrayBuffer : public Object {
/**
* Allocate |length| bytes. Return NULL if allocation is not successful.
+ * Memory should be initialized to zeroes.
*/
virtual void* Allocate(size_t length) = 0;
+
+ /**
+ * Allocate |length| bytes. Return NULL if allocation is not successful.
+ * Memory does not have to be initialized.
+ */
+ virtual void* AllocateUninitialized(size_t length) {
+ // Override with call to |Allocate| for compatibility
+ // with legacy version.
+ return Allocate(length);
+ }
+
/**
* Free the memory pointed to |data|. That memory is guaranteed to be
* previously allocated by |Allocate|.
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698