diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-20 11:45:03 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-20 11:45:03 +0000 |
commit | c46cf680d859c18190cfcf774f546ad660c60643 (patch) | |
tree | 022b4b373a7fac2eb4c3271a33945a2f6fb13c67 /vespalib | |
parent | d378999c80c91880f8fb1b9ba08b5b8bdba130d2 (diff) |
Less inlining and hide some methods
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/hashtable.h | 8 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/hashtable.hpp | 2 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/optimized.h | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/vespalib/src/vespa/vespalib/stllike/hashtable.h b/vespalib/src/vespa/vespalib/stllike/hashtable.h index 4dbb138f63d..8665b4d235e 100644 --- a/vespalib/src/vespa/vespalib/stllike/hashtable.h +++ b/vespalib/src/vespa/vespalib/stllike/hashtable.h @@ -305,7 +305,7 @@ public: } // This will insert unconditionally, without checking presence, and might cause duplicates. // Use at you own risk. - void force_insert(Value && value); + VESPA_DLL_LOCAL void force_insert(Value && value) __attribute__((noinline)); /// This gives faster iteration than can be achieved by the iterators. template <typename Func> @@ -318,7 +318,7 @@ public: } } void clear(); - void resize(size_t newSize); + void resize(size_t newSize) __attribute__((noinline)); void swap(hashtable & rhs); /** @@ -335,7 +335,7 @@ public: protected: template <typename V> - insert_result insertInternal(V && node); + insert_result insertInternal(V && node) __attribute__((noinline)); /// These two methods are only for the ones that know what they are doing. /// valid input here are stuff returned from iterator.getInternalIndex. Value & getByInternalIndex(size_t index) { return _nodes[index].getValue(); } @@ -362,7 +362,7 @@ private: moveHandler.move(from, to); } template <typename MoveHandler> - void reclaim(MoveHandler & moveHandler, next_t node); + VESPA_DLL_LOCAL void reclaim(MoveHandler & moveHandler, next_t node); }; } diff --git a/vespalib/src/vespa/vespalib/stllike/hashtable.hpp b/vespalib/src/vespa/vespalib/stllike/hashtable.hpp index cd0a4fbee80..f60e98c350e 100644 --- a/vespalib/src/vespa/vespalib/stllike/hashtable.hpp +++ b/vespalib/src/vespa/vespalib/stllike/hashtable.hpp @@ -192,7 +192,7 @@ hashtable<Key, Value, Hash, Equal, KeyExtract, Modulator>::force_insert(Value && _nodes[h] = std::move(value); _count++; } else { - if (_nodes.size() < _nodes.capacity()) { + if (_nodes.size() < _nodes.capacity()) [[likely]] { const next_t p(_nodes[h].getNext()); const next_t newIdx(_nodes.size()); _nodes[h].setNext(newIdx); diff --git a/vespalib/src/vespa/vespalib/util/optimized.h b/vespalib/src/vespa/vespalib/util/optimized.h index 96566276f36..e78372b03ff 100644 --- a/vespalib/src/vespa/vespalib/util/optimized.h +++ b/vespalib/src/vespa/vespalib/util/optimized.h @@ -103,5 +103,7 @@ inline int Optimized::lsbIdx(unsigned long v) { return v ? __builtin_ctzl(v) : 0 inline int Optimized::lsbIdx(unsigned long long v) { return v ? __builtin_ctzll(v) : 0; } #endif +#define VESPA_DLL_LOCAL __attribute__ ((visibility("hidden"))) + } |