Hacker News new | past | comments | ask | show | jobs | submit login

SDS works by allocating a chunk of memory that can fit a header + your string data. The APIs all consume pointers and internally it mutates it's copy of the pointer so it can get at the metadata. So it can be used to generate strings that are passed to other things. I don't think it's easy to use sds operations on other strings in a zero-copy way.



Reminds me of libowfat [0]'s stralloc/buffer. It's used in gatling[1], a small (LOC/binary) http/ftp/samba server simple nonblocking IO.

[0]: https://www.fefe.de/libowfat/ [1]: https://www.fefe.de/gatling/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: