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