ccan/membuf
Hi all,
I've found myself open-coding linear memory queues in several
places; particularly for strings which want memory continuity. They're pretty inefficient (realloc, memmove) for a huge number of elements, but they're great for things you expect to be small.
I'm adapting my code to use it now, but here's the patch if anyone is interested in nitpicking the API!
Cheers,
Rusty.
Subject: membuf: new module for linear memory buffers.
Signed-off-by Rusty Russell <[email protected]>
ccan/membuf/LICENSE new file +1 -0
@@ -0,0 +1 @@ +../../licenses/BSD-MIT
ccan/membuf/_info new file +51 -0
51 lines not on this page · raw message
ccan/membuf/membuf.c new file +60 -0
60 lines not on this page · raw message
ccan/membuf/membuf.h new file +209 -0
209 lines not on this page · raw message
ccan/membuf/test/run.c new file +103 -0
103 lines not on this page · raw message