Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/talloc/talloc_guide.txt

    r414 r745  
    7575synchronization.
    7676
     77talloc and shared objects
     78-------------------------
     79
     80talloc can be used in shared objects. Special care needs to be taken
     81to never use talloc_autofree_context() in code that might be loaded
     82with dlopen() and unloaded with dlclose(), as talloc_autofree_context()
     83internally uses atexit(3). Some platforms like modern Linux handles
     84this fine, but for example FreeBSD does not deal well with dlopen()
     85and atexit() used simultaneously: dlclose() does not clean up the list
     86of atexit-handlers, so when the program exits the code that was
     87registered from within talloc_autofree_context() is gone, the program
     88crashes at exit.
     89
    7790
    7891=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     
    118131
    119132The return value of talloc_free() indicates success or failure, with 0
    120 returned for success and -1 for failure. The only possible failure
    121 condition is if the pointer had a destructor attached to it and the
    122 destructor returned -1. See talloc_set_destructor() for details on
    123 destructors.
     133returned for success and -1 for failure. A possible failure condition
     134is if the pointer had a destructor attached to it and the destructor
     135returned -1. See talloc_set_destructor() for details on
     136destructors. Likewise, if "ptr" is NULL, then the function will make
     137no modifications and returns -1.
    124138
    125139If this pointer has an additional parent when talloc_free() is called
     
    653667
    654668=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    655 ((type *)talloc_array(const void *ctx, type, uint_t count);
     669((type *)talloc_array(const void *ctx, type, unsigned int count);
    656670
    657671The talloc_array() macro is equivalent to::
     
    664678
    665679=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    666 void *talloc_array_size(const void *ctx, size_t size, uint_t count);
     680void *talloc_array_size(const void *ctx, size_t size, unsigned int count);
    667681
    668682The talloc_array_size() function is useful when the type is not
     
    671685
    672686=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    673 (typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, uint_t count);
     687(typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, unsigned int count);
    674688
    675689The talloc_ptrtype() macro should be used when you have a pointer to an array
Note: See TracChangeset for help on using the changeset viewer.