diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-20 13:04:27 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-20 13:04:27 +0000 |
commit | 12f27fcc49be2a1f444122a185735743c18684f6 (patch) | |
tree | 0e0b7d1ba0cc97ed35cf961eae8d1993f1fda3fa /vespalib | |
parent | 36f8d6761ef4bed884c884c7f673e6c7d847af7f (diff) |
Allow for faster access of thread local variable.
This is possible since we do not load our code explicit as dynamic library.
Also replace __thread by standard c++ linkage thread_local.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/string.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/stllike/string.h b/vespalib/src/vespa/vespalib/stllike/string.h index f1207c1d9b8..1ca0ef1da77 100644 --- a/vespalib/src/vespa/vespalib/stllike/string.h +++ b/vespalib/src/vespa/vespalib/stllike/string.h @@ -7,6 +7,8 @@ #include <cstdlib> #include <vespa/vespalib/util/alloc.h> +#define VESPA_DLL_LOCAL __attribute__ ((visibility("hidden"))) + namespace vespalib { /** @@ -567,7 +569,7 @@ private: bool isAllocated() const { return _buf != _stack; } char * buffer() { return _buf; } const char * buffer() const { return _buf; } - void appendAlloc(const void * s, size_type sz) __attribute__((noinline)); + VESPA_DLL_LOCAL void appendAlloc(const void * s, size_type sz) __attribute__((noinline)); void init(const void *s) noexcept { if (__builtin_expect(_sz < StackSize, true)) { _bufferSize = StackSize; |