[PATCH] talloc: Add a warning to talloc_reference() documentation.
Andreas Schneider
asn at samba.org
Mon Oct 14 05:18:30 MDT 2013
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/talloc/talloc.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 1b59390..5d29a8d 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -961,6 +961,10 @@ size_t talloc_reference_count(const void *ptr);
* @return The original pointer 'ptr', NULL if talloc ran out of
* memory in creating the reference.
*
+ * @warning You should try to avoid using this interface. It turns a beautiful
+ * talloc-tree into a graph. It is often really hard to debug if you
+ * screw something up by accident.
+ *
* Example:
* @code
* unsigned int *a, *b, *c;
@@ -1001,6 +1005,10 @@ void *_talloc_reference_loc(const void *context, const void *ptr, const char *lo
* this function will fail and will return -1. Likewise, if ptr is NULL,
* then the function will make no modifications and return -1.
*
+ * @warning You should try to avoid using this interface. It turns a beautiful
+ * talloc-tree into a graph. It is often really hard to debug if you
+ * screw something up by accident.
+ *
* Example:
* @code
* unsigned int *a, *b, *c;
--
1.8.4
More information about the samba-technical
mailing list