Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
56ffdfc6
Commit
56ffdfc6
authored
Feb 08, 2018
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer: deprecate `git_buf_free` in favor of `git_buf_dispose`
parent
396e4960
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
include/git2/buffer.h
+13
-1
src/buffer.c
+6
-1
No files found.
include/git2/buffer.h
View file @
56ffdfc6
...
@@ -69,7 +69,19 @@ typedef struct {
...
@@ -69,7 +69,19 @@ typedef struct {
*
*
* @param buffer The buffer to deallocate
* @param buffer The buffer to deallocate
*/
*/
GIT_EXTERN
(
void
)
git_buf_free
(
git_buf
*
buffer
);
GIT_EXTERN
(
void
)
git_buf_dispose
(
git_buf
*
buffer
);
/**
* Alias of `git_buf_dispose`.
*
* This function is directly calls `git_buf_dispose` now and is deprecated.
* Going forward, we refer to functions freeing the internal state of a
* structure a `dispose` function, while functions freeing the structure
* themselves will be called a `free` function.
*
* This function is going to be removed in v0.30.0.
*/
GIT_EXTERN
(
void
)
GIT_DEPRECATED
(
git_buf_free
)(
git_buf
*
buffer
);
/**
/**
* Resize the buffer allocation to make more space.
* Resize the buffer allocation to make more space.
...
...
src/buffer.c
View file @
56ffdfc6
...
@@ -116,7 +116,7 @@ int git_buf_grow_by(git_buf *buffer, size_t additional_size)
...
@@ -116,7 +116,7 @@ int git_buf_grow_by(git_buf *buffer, size_t additional_size)
return
git_buf_try_grow
(
buffer
,
newsize
,
true
);
return
git_buf_try_grow
(
buffer
,
newsize
,
true
);
}
}
void
git_buf_
fre
e
(
git_buf
*
buf
)
void
git_buf_
dispos
e
(
git_buf
*
buf
)
{
{
if
(
!
buf
)
return
;
if
(
!
buf
)
return
;
...
@@ -126,6 +126,11 @@ void git_buf_free(git_buf *buf)
...
@@ -126,6 +126,11 @@ void git_buf_free(git_buf *buf)
git_buf_init
(
buf
,
0
);
git_buf_init
(
buf
,
0
);
}
}
void
git_buf_free
(
git_buf
*
buf
)
{
git_buf_dispose
(
buf
);
}
void
git_buf_sanitize
(
git_buf
*
buf
)
void
git_buf_sanitize
(
git_buf
*
buf
)
{
{
if
(
buf
->
ptr
==
NULL
)
{
if
(
buf
->
ptr
==
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment