From 8ad1778b500341e662144a952ec6aa4fa52ddf4c Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Wed, 12 Aug 2015 01:00:08 -0700 Subject: [PATCH] Make list constructor usable without list-inl.h header. R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/1289553002 Cr-Commit-Position: refs/heads/master@{#30126} --- src/d8-posix.cc | 4 ---- src/list-inl.h | 9 --------- src/list.h | 7 ++++++- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/d8-posix.cc b/src/d8-posix.cc index 0f37ccefb..36d83b53c 100644 --- a/src/d8-posix.cc +++ b/src/d8-posix.cc @@ -15,10 +15,6 @@ #include "src/d8.h" -#ifndef V8_SHARED -#include "src/list-inl.h" -#endif - #if !V8_OS_NACL #include #endif diff --git a/src/list-inl.h b/src/list-inl.h index 47653ef14..94ef14dba 100644 --- a/src/list-inl.h +++ b/src/list-inl.h @@ -245,15 +245,6 @@ void List::StableSort() { } -template -void List::Initialize(int capacity, P allocator) { - DCHECK(capacity >= 0); - data_ = (capacity > 0) ? NewData(capacity, allocator) : NULL; - capacity_ = capacity; - length_ = 0; -} - - template int SortedListBSearch(const List& list, P cmp) { int low = 0; diff --git a/src/list.h b/src/list.h index 8021a9fbe..d935f764b 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_; -- 2.34.1