diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-01-10 20:37:04 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-01-10 20:37:04 -0800 |
commit | bcc688a303439c758a47da9f0eb1c064ece6ce09 (patch) | |
tree | 4a6cfe35a040bffcb48a18ceac90506752244af6 /core/upb_string.h | |
parent | 45599180905d45a882970f6ca8b6007436ac3f97 (diff) |
upb_def compiles again!
Diffstat (limited to 'core/upb_string.h')
-rw-r--r-- | core/upb_string.h | 13 |
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 |