From 9420234a989078d8965dde186031fbab418ab1e6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 22 Jan 2020 22:06:35 +0100 Subject: [PATCH] Force inline flat_hash_map wrappers. --- server/tracy_flat_hash_map.hpp | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/server/tracy_flat_hash_map.hpp b/server/tracy_flat_hash_map.hpp index 69e77d20..725cc441 100644 --- a/server/tracy_flat_hash_map.hpp +++ b/server/tracy_flat_hash_map.hpp @@ -123,44 +123,44 @@ struct KeyOrValueEquality : functor_storage : equality_storage(equality) { } - bool operator()(const key_type & lhs, const key_type & rhs) + tracy_force_inline bool operator()(const key_type & lhs, const key_type & rhs) { return static_cast(*this)(lhs, rhs); } - bool operator()(const key_type & lhs, const value_type & rhs) + tracy_force_inline bool operator()(const key_type & lhs, const value_type & rhs) { return static_cast(*this)(lhs, rhs.first); } - bool operator()(const value_type & lhs, const key_type & rhs) + tracy_force_inline bool operator()(const value_type & lhs, const key_type & rhs) { return static_cast(*this)(lhs.first, rhs); } - bool operator()(const value_type & lhs, const value_type & rhs) + tracy_force_inline bool operator()(const value_type & lhs, const value_type & rhs) { return static_cast(*this)(lhs.first, rhs.first); } template - bool operator()(const key_type & lhs, const std::pair & rhs) + tracy_force_inline bool operator()(const key_type & lhs, const std::pair & rhs) { return static_cast(*this)(lhs, rhs.first); } template - bool operator()(const std::pair & lhs, const key_type & rhs) + tracy_force_inline bool operator()(const std::pair & lhs, const key_type & rhs) { return static_cast(*this)(lhs.first, rhs); } template - bool operator()(const value_type & lhs, const std::pair & rhs) + tracy_force_inline bool operator()(const value_type & lhs, const std::pair & rhs) { return static_cast(*this)(lhs.first, rhs.first); } template - bool operator()(const std::pair & lhs, const value_type & rhs) + tracy_force_inline bool operator()(const std::pair & lhs, const value_type & rhs) { return static_cast(*this)(lhs.first, rhs.first); } template - bool operator()(const std::pair & lhs, const std::pair & rhs) + tracy_force_inline bool operator()(const std::pair & lhs, const std::pair & rhs) { return static_cast(*this)(lhs.first, rhs.first); } @@ -481,16 +481,16 @@ public: using pointer = ValueType *; using reference = ValueType &; - friend bool operator==(const templated_iterator & lhs, const templated_iterator & rhs) + tracy_force_inline friend bool operator==(const templated_iterator & lhs, const templated_iterator & rhs) { return lhs.current == rhs.current; } - friend bool operator!=(const templated_iterator & lhs, const templated_iterator & rhs) + tracy_force_inline friend bool operator!=(const templated_iterator & lhs, const templated_iterator & rhs) { return !(lhs == rhs); } - templated_iterator & operator++() + tracy_force_inline templated_iterator & operator++() { do { @@ -499,23 +499,23 @@ public: while(current->is_empty()); return *this; } - templated_iterator operator++(int) + tracy_force_inline templated_iterator operator++(int) { templated_iterator copy(*this); ++*this; return copy; } - ValueType & operator*() const + tracy_force_inline ValueType & operator*() const { return current->value; } - ValueType * operator->() const + tracy_force_inline ValueType * operator->() const { return std::addressof(current->value); } - operator templated_iterator() const + tracy_force_inline operator templated_iterator() const { return templated_iterator { current }; } @@ -539,19 +539,19 @@ public: return const_iterator { it }; } } - const_iterator cbegin() const + tracy_force_inline const_iterator cbegin() const { return begin(); } - iterator end() + tracy_force_inline iterator end() { return iterator { entries + static_cast(num_slots_minus_one + max_lookups) }; } - const_iterator end() const + tracy_force_inline const_iterator end() const { return const_iterator { entries + static_cast(num_slots_minus_one + max_lookups) }; } - const_iterator cend() const + tracy_force_inline const_iterator cend() const { return end(); } @@ -909,17 +909,17 @@ private: } template - size_t hash_object(const U & key) + tracy_force_inline size_t hash_object(const U & key) { return static_cast(*this)(key); } template - size_t hash_object(const U & key) const + tracy_force_inline size_t hash_object(const U & key) const { return static_cast(*this)(key); } template - bool compares_equal(const L & lhs, const R & rhs) + tracy_force_inline bool compares_equal(const L & lhs, const R & rhs) { return static_cast(*this)(lhs, rhs); } @@ -1256,7 +1256,7 @@ private: struct power_of_two_hash_policy { - size_t index_for_hash(size_t hash, size_t num_slots_minus_one) const + tracy_force_inline size_t index_for_hash(size_t hash, size_t num_slots_minus_one) const { return hash & num_slots_minus_one; }