diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2013-04-16 21:57:21 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2013-04-16 21:57:35 -0400 |
commit | 4d2813d3e980c8e6150caafa604a78cc44bf62a2 (patch) | |
tree | b818e2f79ffcce1e751916b7b2807edd01cf0165 /src/hb-set.cc | |
parent | 1357c2dd120d005ceecfa83ed328d05dc634d7bc (diff) |
Print set-digest hit ratio with HB_DEBUG_SET_DIGESTS
Diffstat (limited to 'src/hb-set.cc')
-rw-r--r-- | src/hb-set.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hb-set.cc b/src/hb-set.cc index 5f427a5d..050cc24e 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -27,6 +27,19 @@ #include "hb-set-private.hh" +#ifdef HB_DEBUG_SET_DIGESTS +unsigned long digest_total, digest_yes, digest_yes1, digest_yes2; +__attribute__((__destructor__)) +void digest_print (void) +{ + if (!digest_total) + return; + printf("Set digest summary: both %%%ld first %%%ld second %%%ld\n", + 100 * digest_yes / digest_total, + 100 * digest_yes1 / digest_total, + 100 * digest_yes2 / digest_total); +} +#endif /* Public API */ |