2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2018-11-30 18:39:55 +03:00
|
|
|
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
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"
|
2018-08-30 23:30:50 +03:00
|
|
|
#include "js/TypeDecls.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 {};
|
|
|
|
|
2018-08-30 23:30:50 +03:00
|
|
|
template <>
|
|
|
|
struct TypeIsGCThing<JS::Value> : mozilla::TrueType {};
|
2015-07-13 22:42:52 +03:00
|
|
|
|
|
|
|
} // namespace detail
|
2013-07-10 03:33:29 +04:00
|
|
|
|
2012-01-03 02:34:25 +04:00
|
|
|
template <typename T, 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 */
|