summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc_guide.txt
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-28 16:55:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:51 -0500
commit5ed074715a7d63b803d5eaff3144a48304201df3 (patch)
treeef049b347d788f7e061a6106d88fbd4575a72179 /source4/lib/talloc/talloc_guide.txt
parent82d4c5095dab0b5c1011fd9f5b865a7c07715a7a (diff)
downloadsamba-5ed074715a7d63b803d5eaff3144a48304201df3.tar.gz
samba-5ed074715a7d63b803d5eaff3144a48304201df3.tar.bz2
samba-5ed074715a7d63b803d5eaff3144a48304201df3.zip
r17886: add talloc_ptrtype() and talloc_array_ptrtype(),
see the manpage what they do:-) metze (This used to be commit bfca83c91e47e9017474809cd7bc8b2e6e20416a)
Diffstat (limited to 'source4/lib/talloc/talloc_guide.txt')
-rw-r--r--source4/lib/talloc/talloc_guide.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/lib/talloc/talloc_guide.txt b/source4/lib/talloc/talloc_guide.txt
index 5aa8dfa24f..65fb2017a4 100644
--- a/source4/lib/talloc/talloc_guide.txt
+++ b/source4/lib/talloc/talloc_guide.txt
@@ -82,6 +82,14 @@ The function talloc_size() should be used when you don't have a
convenient type to pass to talloc(). Unlike talloc(), it is not type
safe (as it returns a void *), so you are on your own for type checking.
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+(typeof(ptr)) talloc_ptrtype(const void *ctx, ptr);
+
+The talloc_ptrtype() macro should be used when you have a pointer and
+want to allocate memory to point at with this pointer. When compiling
+with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_size()
+and talloc_get_name() will return the current location in the source file.
+and not the type.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
int talloc_free(void *ptr);
@@ -515,6 +523,14 @@ The talloc_array_size() function is useful when the type is not
known. It operates in the same way as talloc_array(), but takes a size
instead of a type.
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+(typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, uint_t count);
+
+The talloc_ptrtype() macro should be used when you have a pointer to an array
+and want to allocate memory of an array to point at with this pointer. When compiling
+with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_array_size()
+and talloc_get_name() will return the current location in the source file.
+and not the type.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
void *talloc_realloc_fn(const void *ctx, void *ptr, size_t size);