summaryrefslogtreecommitdiff
path: root/lib/talloc/talloc_guide.txt
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-14 18:36:49 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-14 18:48:20 +0200
commit2de63aa2801a907905b3e05557074af5b896d486 (patch)
tree728094b47b5b26c0c073bf927db3c0443148d142 /lib/talloc/talloc_guide.txt
parent07af3f289e403396a9ddef744cf42e2badc1f1cc (diff)
downloadsamba-2de63aa2801a907905b3e05557074af5b896d486.tar.gz
samba-2de63aa2801a907905b3e05557074af5b896d486.tar.bz2
samba-2de63aa2801a907905b3e05557074af5b896d486.zip
talloc:documentation - explain that "talloc_free" works also with "NULL" pointers
(talloc.c) ... > static inline int _talloc_free_internal(void *ptr, const char *location) > { > struct talloc_chunk *tc; > > if (unlikely(ptr == NULL)) { > return -1; > } > > tc = talloc_chunk_from_ptr(ptr); ... Obviously this never had been documented before.
Diffstat (limited to 'lib/talloc/talloc_guide.txt')
-rw-r--r--lib/talloc/talloc_guide.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/talloc/talloc_guide.txt b/lib/talloc/talloc_guide.txt
index 79387bfd46..a79fd03a83 100644
--- a/lib/talloc/talloc_guide.txt
+++ b/lib/talloc/talloc_guide.txt
@@ -117,10 +117,11 @@ children. You can call talloc_free() on any pointer returned by
talloc().
The return value of talloc_free() indicates success or failure, with 0
-returned for success and -1 for failure. The only possible failure
-condition is if the pointer had a destructor attached to it and the
-destructor returned -1. See talloc_set_destructor() for details on
-destructors.
+returned for success and -1 for failure. A possible failure condition
+is if the pointer had a destructor attached to it and the destructor
+returned -1. See talloc_set_destructor() for details on
+destructors. Likewise, if "ptr" is NULL, then the function will make
+no modifications and returns -1.
If this pointer has an additional parent when talloc_free() is called
then the memory is not actually released, but instead the most