File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,22 @@ extern char strbuf_slopbuf[];
82
82
extern void strbuf_init (struct strbuf * , size_t );
83
83
84
84
/**
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.
87
91
*/
88
92
extern void strbuf_release (struct strbuf * );
89
93
90
94
/**
91
95
* Detach the string from the strbuf and returns it; you now own the
92
96
* storage the string occupies and it is your responsibility from then on
93
97
* 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.
94
101
*/
95
102
extern char * strbuf_detach (struct strbuf * , size_t * );
96
103
You can’t perform that action at this time.
0 commit comments