Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d419d5c9
Commit
d419d5c9
authored
Jul 18, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
talloc_free() should take a const void *, a-la free().
parent
3c81225f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ccan/talloc/talloc.c
ccan/talloc/talloc.c
+2
-2
ccan/talloc/talloc.h
ccan/talloc/talloc.h
+1
-1
No files found.
ccan/talloc/talloc.c
View file @
d419d5c9
...
...
@@ -819,12 +819,12 @@ void *talloc_named_const(const void *context, size_t size, const char *name)
will not be freed if the ref_count is > 1 or the destructor (if
any) returns non-zero
*/
int
talloc_free
(
void
*
ptr
)
int
talloc_free
(
const
void
*
ptr
)
{
int
saved_errno
=
errno
,
ret
;
lock
(
ptr
);
ret
=
_talloc_free
(
ptr
);
ret
=
_talloc_free
(
discard_const_p
(
void
,
ptr
)
);
unlock
();
if
(
ret
==
0
)
errno
=
saved_errno
;
...
...
ccan/talloc/talloc.h
View file @
d419d5c9
...
...
@@ -119,7 +119,7 @@
* See Also:
* talloc_set_destructor, talloc_unlink
*/
int
talloc_free
(
void
*
ptr
);
int
talloc_free
(
const
void
*
ptr
);
/**
* talloc_set_destructor: set a destructor for when this pointer is freed
...
...
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