Revision 2.4.4.
Fix bug with hangs on very large sparse arrays.
Try harder to free up memory when running out of space.
Add heap snapshots to JSON format to API.
Recalibrate benchmarks.
Review URL: http://codereview.chromium.org/3421009
git-svn-id: http://v8.googlecode.com/svn/trunk@5462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/utils.h b/src/utils.h
index d605891..fefbfe9 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -391,6 +391,12 @@
// Factory method for creating empty vectors.
static Vector<T> empty() { return Vector<T>(NULL, 0); }
+ template<typename S>
+ static Vector<T> cast(Vector<S> input) {
+ return Vector<T>(reinterpret_cast<T*>(input.start()),
+ input.length() * sizeof(S) / sizeof(T));
+ }
+
protected:
void set_start(T* start) { start_ = start; }