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

Side by Side Diff: src/list.h

Issue 10682: Inverted character classes (Closed)
Patch Set: Created 12 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Drops all but the first 'pos' elements from the list. 95 // Drops all but the first 'pos' elements from the list.
96 INLINE(void Rewind(int pos)); 96 INLINE(void Rewind(int pos));
97 97
98 bool Contains(const T& elm); 98 bool Contains(const T& elm);
99 99
100 // Iterate through all list entries, starting at index 0. 100 // Iterate through all list entries, starting at index 0.
101 void Iterate(void (*callback)(T* x)); 101 void Iterate(void (*callback)(T* x));
102 102
103 // Sort all list entries (using QuickSort) 103 // Sort all list entries (using QuickSort)
104 void Sort(int (*cmp)(const T* x, const T* y)); 104 void Sort(int (*cmp)(const T* x, const T* y));
105 void Sort();
105 106
106 INLINE(void Initialize(int capacity)); 107 INLINE(void Initialize(int capacity));
107 108
108 private: 109 private:
109 T* data_; 110 T* data_;
110 int capacity_; 111 int capacity_;
111 int length_; 112 int length_;
112 113
113 INLINE(T* NewData(int n)) { return static_cast<T*>(P::New(n * sizeof(T))); } 114 INLINE(T* NewData(int n)) { return static_cast<T*>(P::New(n * sizeof(T))); }
114 INLINE(void DeleteData(T* data)) { P::Delete(data); } 115 INLINE(void DeleteData(T* data)) { P::Delete(data); }
115 116
116 DISALLOW_COPY_AND_ASSIGN(List); 117 DISALLOW_COPY_AND_ASSIGN(List);
117 }; 118 };
118 119
119 120
120 } } // namespace v8::internal 121 } } // namespace v8::internal
121 122
122 #endif // V8_LIST_H_ 123 #endif // V8_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698