2018-11-30 19:52:05 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2018-11-30 15:39:55 +00:00
|
|
|
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
2012-05-21 11:12:37 +00: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 00:19:42 +00:00
|
|
|
|
2013-06-20 00:59:09 +00:00
|
|
|
#ifndef js_Vector_h
|
|
|
|
#define js_Vector_h
|
2009-07-01 00:19:42 +00:00
|
|
|
|
2013-07-09 23:33:29 +00:00
|
|
|
#include "mozilla/Vector.h"
|
2018-08-30 20:30:50 +00:00
|
|
|
#include "js/TypeDecls.h"
|
2009-08-08 03:09:11 +00:00
|
|
|
|
2009-09-02 01:46:19 +00:00
|
|
|
namespace js {
|
2009-07-01 00:19:42 +00:00
|
|
|
|
2012-01-02 22:34:25 +00:00
|
|
|
class TempAllocPolicy;
|
|
|
|
|
2015-07-13 19:42:52 +00:00
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct TypeIsGCThing : mozilla::FalseType {};
|
|
|
|
|
2018-08-30 20:30:50 +00:00
|
|
|
template <>
|
|
|
|
struct TypeIsGCThing<JS::Value> : mozilla::TrueType {};
|
2015-07-13 19:42:52 +00:00
|
|
|
|
|
|
|
} // namespace detail
|
2013-07-09 23:33:29 +00:00
|
|
|
|
2012-01-02 22:34:25 +00:00
|
|
|
template <typename T, size_t MinInlineCapacity = 0,
|
2016-07-28 05:59:55 +00:00
|
|
|
class AllocPolicy = TempAllocPolicy,
|
2019-03-26 13:58:20 +00:00
|
|
|
// Don't use this with JS::Value! Use JS::RootedValueVector instead.
|
2016-07-28 05:59:55 +00:00
|
|
|
typename = typename mozilla::EnableIf<
|
|
|
|
!detail::TypeIsGCThing<T>::value>::Type>
|
2015-07-13 19:42:52 +00:00
|
|
|
using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;
|
2009-07-01 00:19:42 +00:00
|
|
|
|
2013-07-09 23:33:29 +00:00
|
|
|
} // namespace js
|
2010-08-02 14:44:24 +00:00
|
|
|
|
2013-06-20 00:59:09 +00:00
|
|
|
#endif /* js_Vector_h */
|