]> git.saurik.com Git - redis.git/commitdiff
added a comment to sdsMakeRoomFor() to make it clear what the function actually does.
authorantirez <antirez@gmail.com>
Wed, 2 Nov 2011 15:09:14 +0000 (16:09 +0100)
committerantirez <antirez@gmail.com>
Wed, 2 Nov 2011 15:09:14 +0000 (16:09 +0100)
src/sds.c

index 2104eb36b9b9fe9475f1a2b8165b24a8e769481a..fc104a4a087674631385bcf74779fa9e5d8a4607 100644 (file)
--- a/src/sds.c
+++ b/src/sds.c
@@ -101,6 +101,12 @@ void sdsclear(sds s) {
     sh->buf[0] = '\0';
 }
 
+/* Enlarge the free space at the end of the sds string so that the caller
+ * is sure that after calling this function can overwrite up to addlen
+ * bytes after the end of the string, plus one more byte for nul term.
+ * 
+ * Note: this does not change the *size* of the sds string as returned
+ * by sdslen(), but only the free buffer space we have. */
 static sds sdsMakeRoomFor(sds s, size_t addlen) {
     struct sdshdr *sh, *newsh;
     size_t free = sdsavail(s);