X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Flikely%2Flikely.h;h=410772dbde78a37ec99c64261758961ae2f2821b;hb=bb2a75f445f408e43730fc55a1a978581ebe9b96;hp=0fad89c42bb80088f78116a8bfb054123c8ef355;hpb=fc00f14087f911da23d1d89e02705c498447db22;p=ccan diff --git a/ccan/likely/likely.h b/ccan/likely/likely.h index 0fad89c4..410772db 100644 --- a/ccan/likely/likely.h +++ b/ccan/likely/likely.h @@ -1,3 +1,4 @@ +/* Licensed under LGPLv2.1+ - see LICENSE file for details */ #ifndef CCAN_LIKELY_H #define CCAN_LIKELY_H #include "config.h" @@ -73,7 +74,7 @@ long _likely_trace(bool cond, bool expect, * @percent: maximum percentage correct * * When CCAN_LIKELY_DEBUG is defined, likely() and unlikely() trace their - * results: this causes a significant slowdown, but allows analysis of + * results: this causes a significant slowdown, but allows analysis of * whether the branches are labelled correctly. * * This function returns a malloc'ed description of the least-correct @@ -100,6 +101,13 @@ long _likely_trace(bool cond, bool expect, * #endif * } */ -const char *likely_stats(unsigned int min_hits, unsigned int percent); +char *likely_stats(unsigned int min_hits, unsigned int percent); + +/** + * likely_stats_reset - free up memory of likely()/unlikely() branches. + * + * This can also plug memory leaks. + */ +void likely_stats_reset(void); #endif /* CCAN_LIKELY_DEBUG */ #endif /* CCAN_LIKELY_H */