127 private links
Vstr is a string library, it's designed so you can work optimally with readv()/writev()
for input/output. This means that, for instance, you can readv()
data to the end of the string and writev()
data from the beginning of the string without having to allocate or move memory. It also means that the library is completely happy with data that has multiple zero bytes in it.
This design constraint means that unlike most string libraries Vstr doesn't have an internal representation of the string where everything can be accessed from a single (char *)
pointer in C, the internal representation is of multiple "blocks" or nodes each carrying some of the data for the string. This model of representing the data also means that as a string gets bigger the Vstr memory usage only goes up linearly and has no inherent copying (due to other string libraries increasing space for the string via. realloc()
the memory usage can be triple the required size and require a complete copy of the string).