]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/tal.h
tal: don't automatically register cleanup function.
[ccan] / ccan / tal / tal.h
index 28be3f2034c133b276bc1a9e7f803df6fa033469..86b56d35a3c26280a9915216a5443ebef78626e1 100644 (file)
@@ -327,6 +327,17 @@ void tal_set_backend(void *(*alloc_fn)(size_t size),
        tal_expand_((void **)(a1p), (a2), sizeof**(a1p),        \
                    (num2) + 0*sizeof(*(a1p) == (a2)))
 
+/**
+ * tal_cleanup - remove pointers from NULL node
+ *
+ * Internally, tal keeps a list of nodes allocated from @ctx NULL; this
+ * prevents valgrind from noticing memory leaks.  This re-initializes
+ * that list to empty.
+ *
+ * It also calls take_cleanup() for you.
+ */
+void tal_cleanup(void);
+
 
 /**
  * tal_check - set the allocation or error functions to use