author | Pierre Habouzit <madcoder@debian.org> | |
Sat, 15 Sep 2007 13:56:50 +0000 (15:56 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Sep 2007 00:30:03 +0000 (17:30 -0700) | ||
commit | 917c9a713397b16671ed5b1f1c159515bcfa389e | |
tree | 666fde07656debe768ad4f388e5a0e87759d3459 | tree | snapshot |
parent | 760da9607ee08e9dd495dee993262bb857694ac9 | commit | diff |
New strbuf APIs: splice and attach.
* strbuf_splice replace a portion of the buffer with another.
* strbuf_attach replace a strbuf buffer with the given one, that should be
malloc'ed. Then it enforces strbuf's invariants. If alloc > len, then this
function has negligible cost, else it will perform a realloc, possibly
with a cost.
Also some style issues are fixed now.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf_splice replace a portion of the buffer with another.
* strbuf_attach replace a strbuf buffer with the given one, that should be
malloc'ed. Then it enforces strbuf's invariants. If alloc > len, then this
function has negligible cost, else it will perform a realloc, possibly
with a cost.
Also some style issues are fixed now.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf.c | diff | blob | history | |
strbuf.h | diff | blob | history |