Hacker News new | ask | show | jobs
by simscitizen 541 days ago
There are quite a few of these "better C string" idioms floating around.

Another one to consider is e.g. https://github.com/antirez/sds (used by Redis), which instead stores the string contents in-line with the metadata.