2 ms·
I wrote a library with similar functionality, also with variable-size header (smaller header for small strings, and bigger when growing). With both heap and sta
by faragon 7y ago
I wrote a library with similar functionality, also with variable-size header (smaller header for small strings, and bigger when growing). With both heap and stack allocation support (contiguous memory for headers and data), Unicode interoperability, and even data compression. Eventually I added support for other data types (vector, map, hash map, set, hash set, bit set). The SDS/SDS-2 is more suited for production, and this is not for recommending mine instead, but if someone wants to check a different implementation looking for ideas (BSD licensed, too):
https://github.com/faragon/libsrt https://github.com/faragon/libsrt