Commit Graph

1 Commits

Author SHA1 Message Date
Marco Bubke
1eb0c94f81 Utils: Add SmallString
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>
2016-02-17 15:07:01 +00:00