summaryrefslogtreecommitdiff
path: root/core/upb_string.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-01-10 20:37:04 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-01-10 20:37:04 -0800
commitbcc688a303439c758a47da9f0eb1c064ece6ce09 (patch)
tree4a6cfe35a040bffcb48a18ceac90506752244af6 /core/upb_string.h
parent45599180905d45a882970f6ca8b6007436ac3f97 (diff)
upb_def compiles again!
Diffstat (limited to 'core/upb_string.h')
-rw-r--r--core/upb_string.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/upb_string.h b/core/upb_string.h
index ee345e3..f82603b 100644
--- a/core/upb_string.h
+++ b/core/upb_string.h
@@ -119,20 +119,21 @@ INLINE const char *upb_string_getrobuf(upb_string *str) { return str->ptr; }
INLINE void upb_string_endread(upb_string *str) { (void)str; }
// Attempts to recycle the string "str" so it may be reused and have different
-// data written to it. The returned string is either "str" if it could be
-// recycled or a newly created string if "str" has other references.
+// data written to it. After the function returns, "str" points to a writable
+// string, which is either the original string if it had no other references
+// or a newly created string if it did have other references.
//
-// As a special case, passing NULL will allocate a new string. This is
-// convenient for the pattern:
+// As a special case, passing a pointer to NULL will allocate a new string.
+// This is convenient for the pattern:
//
// upb_string *str = NULL;
// while (x) {
// if (y) {
-// str = upb_string_tryrecycle(str);
+// upb_string_recycle(&str);
// upb_src_getstr(str);
// }
// }
-upb_string *upb_string_tryrecycle(upb_string *str);
+upb_string *upb_string_recycle(upb_string **str);
// The options for setting the contents of a string. These may only be called
// when a string is first created or recycled; once other functions have been
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback