Changeset 745 for trunk/server/lib/talloc/talloc_guide.txt
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/lib/talloc/talloc_guide.txt
r414 r745 75 75 synchronization. 76 76 77 talloc and shared objects 78 ------------------------- 79 80 talloc can be used in shared objects. Special care needs to be taken 81 to never use talloc_autofree_context() in code that might be loaded 82 with dlopen() and unloaded with dlclose(), as talloc_autofree_context() 83 internally uses atexit(3). Some platforms like modern Linux handles 84 this fine, but for example FreeBSD does not deal well with dlopen() 85 and atexit() used simultaneously: dlclose() does not clean up the list 86 of atexit-handlers, so when the program exits the code that was 87 registered from within talloc_autofree_context() is gone, the program 88 crashes at exit. 89 77 90 78 91 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- … … 118 131 119 132 The 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. 133 returned for success and -1 for failure. A possible failure condition 134 is if the pointer had a destructor attached to it and the destructor 135 returned -1. See talloc_set_destructor() for details on 136 destructors. Likewise, if "ptr" is NULL, then the function will make 137 no modifications and returns -1. 124 138 125 139 If this pointer has an additional parent when talloc_free() is called … … 653 667 654 668 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 655 ((type *)talloc_array(const void *ctx, type, u int_t count);669 ((type *)talloc_array(const void *ctx, type, unsigned int count); 656 670 657 671 The talloc_array() macro is equivalent to:: … … 664 678 665 679 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 666 void *talloc_array_size(const void *ctx, size_t size, u int_t count);680 void *talloc_array_size(const void *ctx, size_t size, unsigned int count); 667 681 668 682 The talloc_array_size() function is useful when the type is not … … 671 685 672 686 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 673 (typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, u int_t count);687 (typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, unsigned int count); 674 688 675 689 The talloc_ptrtype() macro should be used when you have a pointer to an array
Note:
See TracChangeset
for help on using the changeset viewer.