summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-11-28 14:44:40 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-12-01 05:54:22 +0100
commit032e25fdc6f5f9c59ead471bc01ad62ae7383d81 (patch)
treef7a7d3fb7687e322e3e696c1d4baecaf87dce477 /lib
parent3c9d703d45a72cf10b4e9065e2071fff84dc67c8 (diff)
downloadsamba-032e25fdc6f5f9c59ead471bc01ad62ae7383d81.tar.gz
talloc: add ASCII art to describe parent/child arrangement
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 927b7f5e5f8..a097ce088df 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -263,7 +263,32 @@ typedef int (*talloc_destructor_t)(void *);
struct talloc_pool_hdr;
struct talloc_chunk {
+ /*
+ * flags includes the talloc magic, which is randomised to
+ * make overwrite attacks harder
+ */
unsigned flags;
+
+ /*
+ * If you have a logical tree like:
+ *
+ * <parent>
+ * / | \
+ * / | \
+ * / | \
+ * <child 1> <child 2> <child 3>
+ *
+ * The actual talloc tree is:
+ *
+ * <parent>
+ * |
+ * <child 1> - <child 2> - <child 3>
+ *
+ * The children are linked with next/prev pointers, and
+ * child 1 is linked to the parent with parent/child
+ * pointers.
+ */
+
struct talloc_chunk *next, *prev;
struct talloc_chunk *parent, *child;
struct talloc_reference_handle *refs;