summaryrefslogtreecommitdiff
path: root/talloc_guide.txt
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-28 11:08:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:25 -0500
commit0a93af206c723be75de55db5d4da2e8d31a17c54 (patch)
tree1189bf6ee6ed64b6a3cb1c0c542d21e3381f88aa /talloc_guide.txt
parent864abe0e45db12b8ba3bc6d0a9c6b5d6ef7d2ddb (diff)
downloadsamba-0a93af206c723be75de55db5d4da2e8d31a17c54.tar.gz
samba-0a93af206c723be75de55db5d4da2e8d31a17c54.tar.bz2
samba-0a93af206c723be75de55db5d4da2e8d31a17c54.zip
r2717: added talloc_p() docs
(This used to be commit 6743ca1b1a24776559aa1c04f0f4a33c67cea8a7)
Diffstat (limited to 'talloc_guide.txt')
-rw-r--r--talloc_guide.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/talloc_guide.txt b/talloc_guide.txt
index 925f485997..ed3f7713aa 100644
--- a/talloc_guide.txt
+++ b/talloc_guide.txt
@@ -65,6 +65,19 @@ level context is created.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+void *talloc_p(const void *context, type);
+
+The talloc_p() macro is the equivalent of
+
+ (type *)talloc(ctx, sizeof(type))
+
+You should use it in preference to talloc() whenever possible, as it
+provides additional type safety. It also automatically calls the
+talloc_set_name_const() function with the name being a string holding
+the name of the type.
+
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
int talloc_free(void *ptr);
The talloc_free() function frees a piece of talloc memory, and all its