2013-04-17 00:47:10 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#ifndef js_Vector_h
|
|
|
|
#define js_Vector_h
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-07-10 03:33:29 +04:00
|
|
|
#include "mozilla/Vector.h"
|
2009-08-08 07:09:11 +04:00
|
|
|
|
2009-09-02 05:46:19 +04:00
|
|
|
namespace js {
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2012-01-03 02:34:25 +04:00
|
|
|
class TempAllocPolicy;
|
|
|
|
|
2015-07-13 22:42:52 +03:00
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct TypeIsGCThing : mozilla::FalseType
|
|
|
|
{};
|
|
|
|
|
|
|
|
// Uncomment this once we actually can assert it:
|
|
|
|
//template <>
|
|
|
|
//struct TypeIsGCThing<JS::Value> : mozilla::TrueType
|
|
|
|
//{};
|
|
|
|
|
|
|
|
} // namespace detail
|
2013-07-10 03:33:29 +04:00
|
|
|
|
|
|
|
template <typename T,
|
2012-01-03 02:34:25 +04:00
|
|
|
size_t MinInlineCapacity = 0,
|
2016-07-28 08:59:55 +03:00
|
|
|
class AllocPolicy = TempAllocPolicy,
|
2015-07-13 22:42:52 +03:00
|
|
|
// Don't use this with JS::Value! Use JS::AutoValueVector instead.
|
2016-07-28 08:59:55 +03:00
|
|
|
typename = typename mozilla::EnableIf<!detail::TypeIsGCThing<T>::value>::Type
|
2015-07-13 22:42:52 +03:00
|
|
|
>
|
|
|
|
using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-07-10 03:33:29 +04:00
|
|
|
} // namespace js
|
2010-08-02 18:44:24 +04:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#endif /* js_Vector_h */
|