X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftal.h;fp=ccan%2Ftal%2Ftal.h;h=86b56d35a3c26280a9915216a5443ebef78626e1;hp=28be3f2034c133b276bc1a9e7f803df6fa033469;hb=8cf5b6208cad807228a69d695e6521122d4b71da;hpb=d21d629add995fe2eefd4290d62499671715b1a9 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