summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asmjit/src/asmjit/core/zonehash.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asmjit/src/asmjit/core/zonehash.h')
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonehash.h64
1 files changed, 16 insertions, 48 deletions
diff --git a/3rdparty/asmjit/src/asmjit/core/zonehash.h b/3rdparty/asmjit/src/asmjit/core/zonehash.h
index 0f1f21f148c..d6cd2e31cb9 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonehash.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonehash.h
@@ -1,25 +1,7 @@
-// AsmJit - Machine code generation for C++
+// This file is part of AsmJit project <https://asmjit.com>
//
-// * Official AsmJit Home Page: https://asmjit.com
-// * Official Github Repository: https://github.com/asmjit/asmjit
-//
-// Copyright (c) 2008-2020 The AsmJit Authors
-//
-// This software is provided 'as-is', without any express or implied
-// warranty. In no event will the authors be held liable for any damages
-// arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it
-// freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not
-// claim that you wrote the original software. If you use this software
-// in a product, an acknowledgment in the product documentation would be
-// appreciated but is not required.
-// 2. Altered source versions must be plainly marked as such, and must not be
-// misrepresented as being the original software.
-// 3. This notice may not be removed or altered from any source distribution.
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
#ifndef ASMJIT_CORE_ZONEHASH_H_INCLUDED
#define ASMJIT_CORE_ZONEHASH_H_INCLUDED
@@ -31,14 +13,9 @@ ASMJIT_BEGIN_NAMESPACE
//! \addtogroup asmjit_zone
//! \{
-// ============================================================================
-// [asmjit::ZoneHashNode]
-// ============================================================================
-
//! Node used by \ref ZoneHash template.
//!
-//! You must provide function `bool eq(const Key& key)` in order to make
-//! `ZoneHash::get()` working.
+//! You must provide function `bool eq(const Key& key)` in order to make `ZoneHash::get()` working.
class ZoneHashNode {
public:
ASMJIT_NONCOPYABLE(ZoneHashNode)
@@ -56,10 +33,6 @@ public:
uint32_t _customData;
};
-// ============================================================================
-// [asmjit::ZoneHashBase]
-// ============================================================================
-
//! Base class used by \ref ZoneHash template
class ZoneHashBase {
public:
@@ -86,7 +59,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneHashBase() noexcept {
+ ASMJIT_INLINE_NODEBUG ZoneHashBase() noexcept {
reset();
}
@@ -126,8 +99,8 @@ public:
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _size == 0; }
- inline size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
//! \}
@@ -162,30 +135,25 @@ public:
//! \}
};
-// ============================================================================
-// [asmjit::ZoneHash]
-// ============================================================================
-
//! Low-level hash table specialized for storing string keys and POD values.
//!
-//! This hash table allows duplicates to be inserted (the API is so low
-//! level that it's up to you if you allow it or not, as you should first
-//! `get()` the node and then modify it or insert a new node by using `insert()`,
-//! depending on the intention).
+//! This hash table allows duplicates to be inserted (the API is so low level that it's up to you if you allow it or
+//! not, as you should first `get()` the node and then modify it or insert a new node by using `insert()`, depending
+//! on the intention).
template<typename NodeT>
class ZoneHash : public ZoneHashBase {
public:
- ASMJIT_NONCOPYABLE(ZoneHash<NodeT>)
+ ASMJIT_NONCOPYABLE(ZoneHash)
typedef NodeT Node;
//! \name Construction & Destruction
//! \{
- inline ZoneHash() noexcept
+ ASMJIT_INLINE_NODEBUG ZoneHash() noexcept
: ZoneHashBase() {}
- inline ZoneHash(ZoneHash&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneHash(ZoneHash&& other) noexcept
: ZoneHash(other) {}
//! \}
@@ -193,7 +161,7 @@ public:
//! \name Utilities
//! \{
- inline void swap(ZoneHash& other) noexcept { ZoneHashBase::_swap(other); }
+ ASMJIT_INLINE_NODEBUG void swap(ZoneHash& other) noexcept { ZoneHashBase::_swap(other); }
template<typename KeyT>
inline NodeT* get(const KeyT& key) const noexcept {
@@ -205,8 +173,8 @@ public:
return node;
}
- inline NodeT* insert(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_insert(allocator, node)); }
- inline NodeT* remove(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_remove(allocator, node)); }
+ ASMJIT_INLINE_NODEBUG NodeT* insert(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_insert(allocator, node)); }
+ ASMJIT_INLINE_NODEBUG NodeT* remove(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_remove(allocator, node)); }
//! \}
};