X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftal.h;h=86b56d35a3c26280a9915216a5443ebef78626e1;hp=28be3f2034c133b276bc1a9e7f803df6fa033469;hb=ba57295a55704ad68f46f7ee741dc8f3ac9db6af;hpb=680aa496521811e7c60afb940bcae5024f4c6adb diff --git a/ccan/tal/tal.h b/ccan/tal/tal.h index 28be3f20..86b56d35 100644 --- a/ccan/tal/tal.h +++ b/ccan/tal/tal.h @@ -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