aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/smallstringliteral.h
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Improve SmallStringMarco Bubke2018-04-041-3/+5
| | | | | | | | | The small string control block moved to the beginning, so it is more cache local. The control block is cleanup too, so it should be easier to read. The alignment is removed because it is creating to big holes. Change-Id: I401aeb9d55455cbaa5e722dd8192e54b525ddc40 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Utils: Fix reverse iterators in SmallStringMarco Bubke2017-09-211-2/+2
| | | | | Change-Id: I859c801fdb1ad68d5943b580f07a9e8260ae192a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils: Add more constexpr to SmallStringMarco Bubke2017-08-301-0/+3
| | | | | Change-Id: I480ef040a8d9c5b9edc515c7fd58db2fad42dc86 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils: Convert to SmallStringView for comparisonMarco Bubke2017-08-291-2/+2
| | | | | Change-Id: I38d9716225b81091e8e75b26c9c2258a2aefa987 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils: Fix long small stringMarco Bubke2017-01-311-1/+1
| | | | | | | | | We used only 6 bit to save the short size but for SmallString with a size over 64 it is not enough. So we have now to use a uint16 instead of a uint8 if the size if over 64. Change-Id: I53558e492b6cb40b739b23a8af83d192a2e11bd2 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Revert "Revert "Utils: Remove old compiler support code""Robert Loehning2017-01-191-13/+0
| | | | | | | | Thomas provided a smaller fix. This reverts commit 78fb7f44bf393d8b9e3e22fcccc4ae7951d4bb6e. Change-Id: I1edff6477526fe4ce29df38852f47fe49117561e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Fixing the compileThomas Hartmann2017-01-191-1/+1
| | | | | | | | * noexcept at wrong postition * alignment cannot be guaranteed when copying the argument Change-Id: Ib68788a3fb781e913bd347e6b7932d3280ba9e67 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Revert "Utils: Remove old compiler support code"Alessandro Portale2017-01-191-0/+13
| | | | | | | | | This reverts commit 8a32bcc5e78032777137298f361d94a3d332fc2b. Broke build with MSVC 2015, update 3 Change-Id: Icb59b70fb00ea2a2ecc8d26c8177d21d82aaccf2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Remove old compiler support codeMarco Bubke2017-01-191-13/+0
| | | | | | | | We now support constexpr, noexcept and alignas on all compilers. Next will be C++ 14 constexpr support. Change-Id: I254049c60dcd82fc373ec907cbb5702a4b344978 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Utils: Changeable SmallString stack sizeTim Jenssen2016-11-011-11/+13
| | | | | | | | | | The size of the small string optimization was hard coded. For some use cases you want a bigger or smaller size. It is now configurable by a template parameter. For that we changed the name to BasicSmallString and added an alias of BasicSmallString<31> to SmallString. Change-Id: I844b4420d260290307a6018bb6cc4cf3ba7bd449 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils: Fix smallstringMarco Bubke2016-08-021-5/+1
| | | | | Change-Id: I681df8c3fd9aa84f14d5d581633894605f56b71a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* SmallString: Fix ambiguity of iteratorsMarco Bubke2016-06-231-2/+2
| | | | | | | | | std::size_t is a undefined unsigned integer type and std::ptrdiff_t is a undefined signed integer type. So sometimes the compiler doesn't know which to choose because both could represent a integer. Change-Id: I669cd44c6f16854dfe3f3cc44edbfc422e1cbd6a Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* Wholesale conversion to #pragma oncehjk2016-03-301-1/+0
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Utils: Rename hasAllocated in isReferenceMarco Bubke2016-02-251-1/+1
| | | | | | | | | HasAllocated it misleading because it means that it has read only references too. Maybe isPointing would be good too but so it is more orthogonal to isReadOnlyReference. Change-Id: I79aaa271aa302de2500c2ea81614e433d76f74ec Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Utils: Rename isReference to isReadOnlyReferenceMarco Bubke2016-02-251-2/+2
| | | | | | | | There is implicit knowledge that the reference is read only in the code so we should honor that and make is explicit. Change-Id: I0d6eab6595ae1414ad2607760a2e02fd49bafd72 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Utils: Add SmallStringMarco Bubke2016-02-171-0/+137
SmallString is a very simple utf8 string class. It's purpose is performance. It uses a short string opimization which provides 31 bytes of heap free memory to save a 30 bytes long string plus null terminator. If the string gets larger heap is allocated. The grow strategy is 1.5 to improve reuse of allocated memory. It uses optionally constexpr to provide string literals. Change-Id: I7757fb51abfeca200d074cbfce2f1d99edc0ecb0 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>