From fde50c633f3a48c8e63718903a77e2c1ecc12a55 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Apr 2010 18:18:53 +1100 Subject: talloc: a useful bit of debug code this is useful when tracking down talloc loops. It is probably too expensive to have on by default. --- lib/talloc/talloc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/talloc/talloc.c') diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 51273dd612..bc1c697789 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -754,6 +754,14 @@ void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const char *locati h->location); } } + +#if 0 + /* this test is probably too expensive to have on in the + normal build, but it useful for debugging */ + if (talloc_is_parent(new_ctx, ptr)) { + talloc_log("WARNING: stealing into talloc child at %s\n", location); + } +#endif return _talloc_steal_internal(new_ctx, ptr); } -- cgit