Changeset 746 for vendor/current/lib/talloc/talloc.h
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/talloc/talloc.h
r740 r746 174 174 * no modifications and return -1. 175 175 * 176 * If this pointer has an additional parent when talloc_free() is called 177 * then the memory is not actually released, but instead the most 178 * recently established parent is destroyed. See talloc_reference() for 179 * details on establishing additional parents. 180 * 181 * For more control on which parent is removed, see talloc_unlink() 182 * 183 * talloc_free() operates recursively on its children. 184 * 185 * From the 2.0 version of talloc, as a special case, talloc_free() is 186 * refused on pointers that have more than one parent, as talloc would 187 * have no way of knowing which parent should be removed. To free a 176 * From version 2.0 and onwards, as a special case, talloc_free() is 177 * refused on pointers that have more than one parent associated, as talloc 178 * would have no way of knowing which parent should be removed. This is 179 * different from older versions in the sense that always the reference to 180 * the most recently established parent has been destroyed. Hence to free a 188 181 * pointer that has more than one parent please use talloc_unlink(). 189 182 * … … 201 194 * talloc_set_log_stderr() for more information on talloc logging 202 195 * functions. 196 * 197 * talloc_free() operates recursively on its children. 203 198 * 204 199 * @param[in] ptr The chunk to be freed. … … 234 229 * talloc_free()s only the children, not the context itself. 235 230 * 236 * @param[in] ptr The chunk that you want to free the children of. 231 * A NULL argument is handled as no-op. 232 * 233 * @param[in] ptr The chunk that you want to free the children of 234 * (NULL is allowed too) 237 235 */ 238 236 void talloc_free_children(void *ptr); … … 403 401 * @param[in] new_ctx The new parent context. 404 402 * 405 * @param[in] p trPointer to the talloc chunk to move.403 * @param[in] pptr Pointer to the talloc chunk to move. 406 404 * 407 405 * @return The pointer of the talloc chunk it has been moved to, 408 406 * NULL on error. 409 407 */ 410 void *talloc_move(const void *new_ctx, const void *ptr);411 #else 412 #define talloc_move(ctx, p tr) (_TALLOC_TYPEOF(*(ptr)))_talloc_move((ctx),(void *)(ptr))408 void *talloc_move(const void *new_ctx, void **pptr); 409 #else 410 #define talloc_move(ctx, pptr) (_TALLOC_TYPEOF(*(pptr)))_talloc_move((ctx),(void *)(pptr)) 413 411 void *_talloc_move(const void *new_ctx, const void *pptr); 414 412 #endif … … 703 701 * @brief Assign a type to a talloc chunk. 704 702 * 705 * This macro allows you to force the name of a pointer to be a particular type.706 * This can be used in conjunction with talloc_get_type() to do type checking on707 * void* pointers.703 * This macro allows you to force the name of a pointer to be of a particular 704 * type. This can be used in conjunction with talloc_get_type() to do type 705 * checking on void* pointers. 708 706 * 709 707 * It is equivalent to this: … … 906 904 * cause this pointer to be freed if it runs out of parents. 907 905 * 908 * - you can talloc_free() the pointer itself . That will destroy the909 * most recently established parent to the pointer and leave the910 * pointer as a child of its current parent.906 * - you can talloc_free() the pointer itself if it has at maximum one 907 * parent. This behaviour has been changed since the release of version 908 * 2.0. Further informations in the description of "talloc_free". 911 909 * 912 910 * For more control on which parent to remove, see talloc_unlink() … … 943 941 * a direct parent of ptr. 944 942 * 945 * Usually you can just use talloc_free() instead of talloc_unlink(), but 946 * sometimes it is useful to have the additional control on which parent is 947 * removed. 943 * You can just use talloc_free() instead of talloc_unlink() if there 944 * is at maximum one parent. This behaviour has been changed since the 945 * release of version 2.0. Further informations in the description of 946 * "talloc_free". 948 947 * 949 948 * @param[in] context The talloc parent to remove. … … 993 992 * @brief Get the size of a talloc chunk. 994 993 * 995 * This function lets you know the amount of memory alloc ed so far by994 * This function lets you know the amount of memory allocated so far by 996 995 * this context. It does NOT account for subcontext memory. 997 996 * This can be used to calculate the size of an array. … … 1454 1453 * 1455 1454 * This function appends the given formatted string to the given string. Use 1456 * this vari ent when the string in the current talloc buffer may have been1455 * this variant when the string in the current talloc buffer may have been 1457 1456 * truncated in length. 1458 1457 * … … 1552 1551 * 1553 1552 * This provides a more detailed report than talloc_report(). It will 1554 * recursively print the en sire tree of memory referenced by the1553 * recursively print the entire tree of memory referenced by the 1555 1554 * pointer. References in the tree are shown by giving the name of the 1556 1555 * pointer that is referenced.
Note:
See TracChangeset
for help on using the changeset viewer.