Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified vendor/current/lib/talloc/talloc_guide.txt

    r740 r746  
    2727
    2828and the pointer X->name would be a "child" of the talloc context "X"
    29 which is itself a child of mem_ctx. So if you do talloc_free(mem_ctx)
     29which is itself a child of "mem_ctx". So if you do talloc_free(mem_ctx)
    3030then it is all destroyed, whereas if you do talloc_free(X) then just X
    3131and X->name are destroyed, and if you do talloc_free(X->name) then
     
    6565the underlying "malloc" is), as long as each thread uses different 
    6666memory contexts.
    67 If two threads uses the same context then they need to synchronize in 
     67If two threads use the same context then they need to synchronize in
    6868order to be safe. In particular:
    6969- when using talloc_enable_leak_report(), giving directly NULL as a 
     
    137137no modifications and returns -1.
    138138
    139 If this pointer has an additional parent when talloc_free() is called
    140 then the memory is not actually released, but instead the most
    141 recently established parent is destroyed. See talloc_reference() for
    142 details on establishing additional parents.
    143 
    144 For more control on which parent is removed, see talloc_unlink()
    145 
    146 talloc_free() operates recursively on its children.
    147 
    148 From the 2.0 version of talloc, as a special case, talloc_free() is
    149 refused on pointers that have more than one parent, as talloc would
    150 have no way of knowing which parent should be removed. To free a
     139From version 2.0 and onwards, as a special case, talloc_free() is
     140refused on pointers that have more than one parent associated, as talloc
     141would have no way of knowing which parent should be removed. This is
     142different from older versions in the sense that always the reference to
     143the most recently established parent has been destroyed. Hence to free a
    151144pointer that has more than one parent please use talloc_unlink().
    152145
     
    163156functions.
    164157
    165 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    166 int talloc_free_children(void *ptr);
     158talloc_free() operates recursively on its children.
     159
     160=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     161void talloc_free_children(void *ptr);
    167162
    168163The talloc_free_children() walks along the list of all children of a
     
    170165itself.
    171166
     167A NULL argument is handled as no-op.
    172168
    173169=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     
    191187    cause this pointer to be freed if it runs out of parents.
    192188
    193   - you can talloc_free() the pointer itself. That will destroy the
    194     most recently established parent to the pointer and leave the
    195     pointer as a child of its current parent.
     189  - you can talloc_free() the pointer itself if it has at maximum one
     190    parent. This behaviour has been changed since the release of version
     191    2.0. Further informations in the description of "talloc_free".
    196192
    197193For more control on which parent to remove, see talloc_unlink()
     
    209205is NULL, then the function will make no modifications and return -1.
    210206
    211 Usually you can just use talloc_free() instead of talloc_unlink(), but
    212 sometimes it is useful to have the additional control on which parent
    213 is removed.
    214 
     207You can just use talloc_free() instead of talloc_unlink() if there
     208is at maximum one parent. This behaviour has been changed since the
     209release of version 2.0. Further informations in the description of
     210"talloc_free".
    215211
    216212=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     
    484480
    485481This provides a more detailed report than talloc_report(). It will
    486 recursively print the ensire tree of memory referenced by the
     482recursively print the entire tree of memory referenced by the
    487483pointer. References in the tree are shown by giving the name of the
    488484pointer that is referenced.
     
    643639The talloc_asprintf_append() function appends the given formatted
    644640string to the given string.
    645 Use this varient when the string in the current talloc buffer may
     641Use this variant when the string in the current talloc buffer may
    646642have been truncated in length.
    647643
     
    657653The talloc_asprintf_append() function appends the given formatted
    658654string to the end of the currently allocated talloc buffer.
    659 Use this varient when the string in the current talloc buffer has
     655Use this variant when the string in the current talloc buffer has
    660656not been changed.
    661657
     
    731727talloc_set_type(const void *ptr, type);
    732728
    733 This macro allows you to force the name of a pointer to be a
     729This macro allows you to force the name of a pointer to be of a
    734730particular type. This can be used in conjunction with
    735731talloc_get_type() to do type checking on void* pointers.
     
    742738talloc_get_size(const void *ctx);
    743739
    744 This function lets you know the amount of memory alloced so far by
     740This function lets you know the amount of memory allocated so far by
    745741this context. It does NOT account for subcontext memory.
    746742This can be used to calculate the size of an array.
     
    769765void talloc_set_log_stderr(void)
    770766
    771 This sets the talloc log function to write log messages to stderr
     767This sets the talloc log function to write log messages to stderr.
Note: See TracChangeset for help on using the changeset viewer.