Make list constructor usable without list-inl.h header.
authormstarzinger <mstarzinger@chromium.org>
Wed, 12 Aug 2015 08:00:08 +0000 (01:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 12 Aug 2015 08:00:18 +0000 (08:00 +0000)
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1289553002

Cr-Commit-Position: refs/heads/master@{#30126}

src/d8-posix.cc
src/list-inl.h
src/list.h

index 0f37ccefbfb31ff095a3190bfc04f9683a0aae0f..36d83b53cff62b84950cf649854be15e2a140225 100644 (file)
 
 #include "src/d8.h"
 
-#ifndef V8_SHARED
-#include "src/list-inl.h"
-#endif
-
 #if !V8_OS_NACL
 #include <sys/select.h>
 #endif
index 47653ef145bdc0ae2b53a2a2004d4c96506672ee..94ef14dbaedba2f1ef1f76f02ae2e563880d0219 100644 (file)
@@ -245,15 +245,6 @@ void List<T, P>::StableSort() {
 }
 
 
-template <typename T, class P>
-void List<T, P>::Initialize(int capacity, P allocator) {
-  DCHECK(capacity >= 0);
-  data_ = (capacity > 0) ? NewData(capacity, allocator) : NULL;
-  capacity_ = capacity;
-  length_ = 0;
-}
-
-
 template <typename T, typename P>
 int SortedListBSearch(const List<T>& list, P cmp) {
   int low = 0;
index 8021a9fbed1e5d955cbf910107f1c26d948ab5f6..d935f764b86efd97fd70d257b58ac39f87ac848e 100644 (file)
@@ -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_;