| 118 | } |
| 119 | |
| 120 | void likely_stats_reset(void) |
| 121 | { |
| 122 | struct thash_iter i; |
| 123 | struct trace *t; |
| 124 | |
| 125 | /* This is a bit better than O(n^2), but we have to loop since |
| 126 | * first/next during delete is unreliable. */ |
| 127 | while ((t = thash_first(&htable, &i)) != NULL) { |
| 128 | for (; t; t = thash_next(&htable, &i)) { |
| 129 | thash_del(&htable, t); |
| 130 | free(t); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | thash_clear(&htable); |
| 135 | } |
| 136 | #endif /*CCAN_LIKELY_DEBUG*/ |