From da5349dede9d4add974da3078437a8513a39bbae Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 22 Mar 2005 06:00:51 +0000 Subject: [PATCH] r5939: improve talloc_realloc() docs after feedback from lifeless (This used to be commit 301cbb0d12919f83d6b735c2e23b49fb49d5394d) --- source4/lib/talloc/talloc_guide.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source4/lib/talloc/talloc_guide.txt b/source4/lib/talloc/talloc_guide.txt index eae6c5e5647..4ab0f8eacc3 100644 --- a/source4/lib/talloc/talloc_guide.txt +++ b/source4/lib/talloc/talloc_guide.txt @@ -267,9 +267,13 @@ particularly useful for creating a new temporary working context. (type *)talloc_realloc(const void *context, void *ptr, type, count); The talloc_realloc() macro changes the size of a talloc -pointer. It has the following equivalences: +pointer. The "count" argument is the number of elements of type "type" +that you want the resulting pointer to hold. + +talloc_realloc() has the following equivalences: talloc_realloc(context, NULL, type, 1) ==> talloc(context, type); + talloc_realloc(context, NULL, type, N) ==> talloc_array(context, type, N); talloc_realloc(context, ptr, type, 0) ==> talloc_free(ptr); The "context" argument is only used if "ptr" is not NULL, otherwise it -- 2.11.4.GIT