diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/talloc/talloc_guide.txt | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/source4/lib/talloc/talloc_guide.txt b/source4/lib/talloc/talloc_guide.txt index 927bd366fd..eae6c5e564 100644 --- a/source4/lib/talloc/talloc_guide.txt +++ b/source4/lib/talloc/talloc_guide.txt @@ -32,10 +32,9 @@ If you think about this, then what this effectively gives you is an n-ary tree, where you can free any part of the tree with talloc_free(). -If you find this confusing, then I suggest you run the LOCAL-TALLOC -smbtorture test to watch talloc in action. You may also like to add -your own tests to source/lib/talloc/testsuite.c to clarify how some -particular situation is handled. +If you find this confusing, then I suggest you run the testsuite to +watch talloc in action. You may also like to add your own tests to +testsuite.c to clarify how some particular situation is handled. Performance @@ -74,6 +73,7 @@ well. Alternatively you can free just the child. The context argument to talloc() can be NULL, in which case a new top level context is created. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- void *talloc_size(const void *context, size_t size); @@ -81,12 +81,6 @@ 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. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -void *talloc_p(const void *context, type); - -talloc_p() is a alias for talloc(). It only exists as a backwards -compatibity macro for code from the bad old days when talloc() was not -type safe. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- int talloc_free(void *ptr); @@ -491,10 +485,13 @@ The talloc_array() macro is equivalent to: except that it provides integer overflow protection for the multiply, returning NULL if the multiply overflows. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- void *talloc_array_size(const void *ctx, size_t size, uint_t count); -The talloc_array_size() function is useful when the type is not known +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. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -506,6 +503,7 @@ implementation encapsulates the functionality of malloc(), free() and realloc() in one call, which is why it is useful to be able to pass around a single function pointer. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- void *talloc_autofree_context(void); @@ -540,7 +538,3 @@ talloc_get_type() to do type checking on void* pointers. It is equivalent to this: talloc_set_name_const(ptr, #type) - - - - |