File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,19 @@ typedef struct {
6969 *
7070 * @param buffer The buffer to deallocate
7171 */
72- GIT_EXTERN (void ) git_buf_free (git_buf * buffer );
72+ GIT_EXTERN (void ) git_buf_dispose (git_buf * buffer );
73+
74+ /**
75+ * Alias of `git_buf_dispose`.
76+ *
77+ * This function is directly calls `git_buf_dispose` now and is deprecated.
78+ * Going forward, we refer to functions freeing the internal state of a
79+ * structure a `dispose` function, while functions freeing the structure
80+ * themselves will be called a `free` function.
81+ *
82+ * This function is going to be removed in v0.30.0.
83+ */
84+ GIT_EXTERN (void ) GIT_DEPRECATED (git_buf_free )(git_buf * buffer );
7385
7486/**
7587 * Resize the buffer allocation to make more space.
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ int git_buf_grow_by(git_buf *buffer, size_t additional_size)
116116 return git_buf_try_grow (buffer , newsize , true);
117117}
118118
119- void git_buf_free (git_buf * buf )
119+ void git_buf_dispose (git_buf * buf )
120120{
121121 if (!buf ) return ;
122122
@@ -126,6 +126,11 @@ void git_buf_free(git_buf *buf)
126126 git_buf_init (buf , 0 );
127127}
128128
129+ void git_buf_free (git_buf * buf )
130+ {
131+ git_buf_dispose (buf );
132+ }
133+
129134void git_buf_sanitize (git_buf * buf )
130135{
131136 if (buf -> ptr == NULL ) {
You can’t perform that action at this time.
0 commit comments