diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-01-26 19:41:26 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-01-26 19:41:26 +0000 |
| commit | 2c425bb4364ba6005fe9e96011511977cdacc63b (patch) | |
| tree | 2cf3c092f7f56ee3f61eccc1edf2d74ccfcee667 /src/shared_string.hh | |
| parent | b697bf1795059800db670452e809df70da30bf75 (diff) | |
Always inline StringStorage methods
Diffstat (limited to 'src/shared_string.hh')
| -rw-r--r-- | src/shared_string.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared_string.hh b/src/shared_string.hh index a3ffcd92..0725c613 100644 --- a/src/shared_string.hh +++ b/src/shared_string.hh @@ -14,8 +14,11 @@ struct StringStorage : UseMemoryDomain<MemoryDomain::SharedString> int refcount; int length; + [[gnu::always_inline]] char* data() { return reinterpret_cast<char*>(this + 1); } + [[gnu::always_inline]] const char* data() const { return reinterpret_cast<const char*>(this + 1); } + [[gnu::always_inline]] StringView strview() const { return {data(), length}; } static StringStorage* create(StringView str, char back = 0) |
