aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/list.h')
-rw-r--r--deps/v8/src/list.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/v8/src/list.h b/deps/v8/src/list.h
index adddea41f0..7350c0d44e 100644
--- a/deps/v8/src/list.h
+++ b/deps/v8/src/list.h
@@ -117,6 +117,9 @@ class List {
// pointer type. Returns the removed element.
INLINE(T RemoveLast()) { return Remove(length_ - 1); }
+ // Deletes current list contents and allocates space for 'length' elements.
+ INLINE(void Allocate(int length));
+
// Clears the list by setting the length to zero. Even if T is a
// pointer type, clearing the list doesn't delete the entries.
INLINE(void Clear());
@@ -173,9 +176,11 @@ typedef List<Handle<Code> > CodeHandleList;
// Perform binary search for an element in an already sorted
// list. Returns the index of the element of -1 if it was not found.
-template <typename T>
-int SortedListBSearch(
- const List<T>& list, T elem, int (*cmp)(const T* x, const T* y));
+// |cmp| is a predicate that takes a pointer to an element of the List
+// and returns +1 if it is greater, -1 if it is less than the element
+// being searched.
+template <typename T, class P>
+int SortedListBSearch(const List<T>& list, P cmp);
template <typename T>
int SortedListBSearch(const List<T>& list, T elem);