summaryrefslogtreecommitdiff
path: root/src/shared_string.hh
AgeCommit message (Collapse)Author
2025-02-04Revert "WIP linked list shared strings"Maxime Coste
This got pushed by accident This reverts commit 2856b99e0914cc7a659977f2b33308cb5b4c9bb7.
2025-01-22WIP linked list shared stringsMaxime Coste
2024-08-14Reduce number of included headersMaxime Coste
2024-02-28Fix missing destructor call and simplify code slightlyMaxime Coste
Although the destructor call is a no-op, it is more correct to have it to ensure the compiler knows the lifetime of that object ended.
2024-02-28Templatize StringData::createMaxime Coste
This improves performance by letting the compiler optimize most use cases where string count and length are known are compile time.
2023-11-17Improve WordDB performance by precomputing hashesMaxime Coste
Avoid multiple computation of string hashes by making it possible to pre-compute and pass hashes to interned strings and hash maps.
2021-10-23src: Fix undefined behaviourFrank LENORMAND
Cppcheck produces the following warnings: ``` shared_string.hh:27:49: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour shared_string.hh:27:49: error: Signed integer overflow for expression '1<<31'. ``` Fixes #4340
2017-03-07Replace uses of UnorderedMap with HashMapMaxime Coste
2017-02-23Refactor StringData and StringRegistry to remove need for purgingMaxime Coste
Purging unused strings could get pretty expensive with a lot of interned strings as it requiered iterating on all of them. Use a flag on the refcount of the StringData to see if the string is interned, and notify the StringRegistry in this case. This should improve the speed of editing big files with many words, such as the one described in #1195
2017-01-30Make SharedString::create take a list of StringViewsMaxime Coste
2017-01-28Remove hash from StringDataMaxime Coste
Maintaining the hash value of strings is not worth it as we only use it for buffer reload, but pay for it on any buffer modifications.
2017-01-08Apply clang-tidy modernize to the codebaseMaxime Coste
2016-12-03Refactor RefPtr handling to use a policy classMaxime Coste
THe previous overload based system was pretty complex for no good reason.
2016-02-05Get rid of SharedStringMaxime Coste
2016-02-05dont intern SharedStrings but StringDataPtrMaxime Coste
2015-11-06Remove unused _ss UDLMaxime Coste
2015-05-14Keep hash stored in StringDataMaxime Coste
2015-05-02Formatting fixMaxime Coste
2015-04-16Use an UnorderedSet for string registryMaxime Coste
2015-03-12Remove unused StaticStringMaxime Coste
2015-03-02Tweak StringData::create implementationMaxime Coste
2015-03-01Use StringDataPtr alias for RefPtr<StringData>Maxime Coste
2015-03-01rename StringStorage to StringDataMaxime Coste
2015-02-28Add StaticStringStorage for storing string literalsMaxime Coste
2015-02-23Use RefPtr as SafePtr backendMaxime Coste
2015-02-19Rename safe_ptr and ref_ptr to SafePtr and RefPtrMaxime Coste
2015-02-10Replace some <cstring> function usage with c++ algorithmsMaxime Coste
2015-01-26Always inline StringStorage methodsMaxime Coste
2015-01-25Tweak SharedStringMaxime Coste
2015-01-24Fix GCC 4.8 compilationMaxime Coste
2015-01-22Avoid temporary strings on buffer load/reloadMaxime Coste
Pass directly a Vector<ref_ptr<StringStorage>> to the buffer
2015-01-19rename SharedString::Storage to StringStorage and use directly in BufferMaxime Coste
2015-01-19Use a single allocation for SharedString::StorageMaxime Coste
2015-01-18Add helper for overloading operator new/deleteMaxime Coste
2015-01-18Replace std::shared_ptr with homemade, intrusive, ref_ptrMaxime Coste
That saves a lot of memory as sizeof(SharedString) is now one pointer less.
2015-01-15Add a no copy shared string constructor, used for map lookup, and intern wordsMaxime Coste
2015-01-15Replace InternedStrings with SharedString, shared_ptr basedMaxime Coste