File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,15 +82,22 @@ extern char strbuf_slopbuf[];
8282extern void strbuf_init (struct strbuf * , size_t );
8383
8484/**
85- * Release a string buffer and the memory it used. You should not use the
86- * string buffer after using this function, unless you initialize it again.
85+ * Release a string buffer and the memory it used. After this call, the
86+ * strbuf points to an empty string that does not need to be free()ed, as
87+ * if it had been set to `STRBUF_INIT` and never modified.
88+ *
89+ * To clear a strbuf in preparation for further use without the overhead
90+ * of free()ing and malloc()ing again, use strbuf_reset() instead.
8791 */
8892extern void strbuf_release (struct strbuf * );
8993
9094/**
9195 * Detach the string from the strbuf and returns it; you now own the
9296 * storage the string occupies and it is your responsibility from then on
9397 * to release it with `free(3)` when you are done with it.
98+ *
99+ * The strbuf that previously held the string is reset to `STRBUF_INIT` so
100+ * it can be reused after calling this function.
94101 */
95102extern char * strbuf_detach (struct strbuf * , size_t * );
96103
You can’t perform that action at this time.
0 commit comments