Files
palemoon27/js/public/Vector.h
T
roytam1 5602866910 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1170325 - Convert js::Vector into a template alias to mozilla::Vector with a single customized default argument. Also get rid of the CRTP support in mozilla::Vector (through mozilla::VectorBase) now that template aliasing is good enough, and make mozilla::Vector final so that people will use composition and not inheritance with it. (Inheritance plays poorly with movability and a few other things, in addition to messing up template argument deduction matching.) r=Waldo, patch sort of a tag-team between him and me (1f663fc5c1)
- Bug 1225682 - Don't use nsAuto{,C}String as class member variables in toolkit/. r=froydnj (7d47cd8c5f)
- Bug 1230409: Implement dummy HeapOffset members for non-ion builds; r=luke (74158a1271)
- Bug 1228369: Rename CodeOffset::use/used into bind/bound; r=luke (90d1b88697)
- Bug 1228340: Remove the js_ prefix in front of IonOptimizationsLevel; r=h4writer (44b79061b3)
- Bug 1229196 - Fix MSVC C4334 "was 64-bit shift intended" warning in js/src/asmjs. r=sunfish (debed181c9)
2023-04-20 11:43:47 +08:00

52 lines
1.5 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* 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/. */
#ifndef js_Vector_h
#define js_Vector_h
#include "mozilla/Vector.h"
/* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4345)
#endif
namespace js {
class TempAllocPolicy;
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
template <typename T,
size_t MinInlineCapacity = 0,
class AllocPolicy = TempAllocPolicy
// 1800 is MSVC2013. Optimistically assume MSVC2015 (1900) is fixed.
// If you're porting to MSVC2015 and this doesn't work, extend the
// condition to encompass that additional version (but *do* keep the
// version-check so we know when MSVC's fixed).
#if !defined(_MSC_VER) || (1800 <= _MSC_VER && _MSC_VER <= 1800)
// Don't use this with JS::Value! Use JS::AutoValueVector instead.
, typename = typename mozilla::EnableIf<!detail::TypeIsGCThing<T>::value>::Type
#endif
>
using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;
} // namespace js
#endif /* js_Vector_h */