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

Unified Diff: src/list.h

Issue 1289553002: Make list constructor usable without list-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-includes-inl-1
Patch Set: Created 5 years, 4 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 | « src/d8-posix.cc ('k') | src/list-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/list.h
diff --git a/src/list.h b/src/list.h
index 8021a9fbed1e5d955cbf910107f1c26d948ab5f6..d935f764b86efd97fd70d257b58ac39f87ac848e 100644
--- a/src/list.h
+++ b/src/list.h
@@ -166,7 +166,12 @@ class List {
void StableSort();
INLINE(void Initialize(int capacity,
- AllocationPolicy allocator = AllocationPolicy()));
+ AllocationPolicy allocator = AllocationPolicy())) {
+ DCHECK(capacity >= 0);
+ data_ = (capacity > 0) ? NewData(capacity, allocator) : NULL;
+ capacity_ = capacity;
+ length_ = 0;
+ }
private:
T* data_;
« no previous file with comments | « src/d8-posix.cc ('k') | src/list-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698