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/. */
|
2010-02-06 21:14:05 +03:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#ifndef js_HashTable_h
|
|
|
|
#define js_HashTable_h
|
2010-02-06 21:14:05 +03:00
|
|
|
|
2018-07-26 13:15:49 +03:00
|
|
|
#include "mozilla/HashTable.h"
|
2012-09-11 00:27:04 +04:00
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
#include "jstypes.h"
|
|
|
|
|
2010-02-06 21:14:05 +03:00
|
|
|
namespace js {
|
|
|
|
|
2018-07-26 11:52:46 +03:00
|
|
|
using HashNumber = mozilla::HashNumber;
|
|
|
|
static const uint32_t kHashNumberBits = mozilla::kHashNumberBits;
|
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API TempAllocPolicy;
|
2012-01-03 02:34:25 +04:00
|
|
|
|
2018-07-26 13:15:49 +03:00
|
|
|
template <class T>
|
|
|
|
using DefaultHasher = mozilla::DefaultHasher<T>;
|
2011-03-24 03:40:11 +03:00
|
|
|
|
2018-07-26 13:15:49 +03:00
|
|
|
template <typename Key>
|
|
|
|
using PointerHasher = mozilla::PointerHasher<Key>;
|
2016-03-09 11:37:20 +03:00
|
|
|
|
2018-07-26 13:15:49 +03:00
|
|
|
template <typename T, class HashPolicy = mozilla::DefaultHasher<T>,
|
2012-11-13 03:30:39 +04:00
|
|
|
class AllocPolicy = TempAllocPolicy>
|
2018-07-26 13:15:49 +03:00
|
|
|
using HashSet = mozilla::HashSet<T, HashPolicy, AllocPolicy>;
|
2010-02-06 21:14:05 +03:00
|
|
|
|
2018-07-26 13:15:49 +03:00
|
|
|
template <typename Key, typename Value,
|
|
|
|
class HashPolicy = mozilla::DefaultHasher<Key>,
|
2012-11-13 03:30:39 +04:00
|
|
|
class AllocPolicy = TempAllocPolicy>
|
2018-07-26 13:15:49 +03:00
|
|
|
using HashMap = mozilla::HashMap<Key, Value, HashPolicy, AllocPolicy>;
|
2010-02-06 21:14:05 +03:00
|
|
|
|
2016-07-13 12:20:00 +03:00
|
|
|
} // namespace js
|
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#endif /* js_HashTable_h */
|