| 256 | |
| 257 | typedef struct { int n[8]; } str32; |
| 258 | void churn32(int a, int b, int count, int include_startup) |
| 259 | { |
| 260 | struct { str32 key; int value; } *map=NULL; |
| 261 | int i,j,n; |
| 262 | str32 key = { 0 }; |
| 263 | for (i=0; i < a; ++i) { |
| 264 | key.n[0] = i; |
| 265 | hmput(map,key,i+1); |
| 266 | } |
| 267 | if (!include_startup) |
| 268 | dont_measure(); |
| 269 | for (n=0; n < count; ++n) { |
| 270 | for (j=a; j < b; ++j,++i) { |
| 271 | key.n[0] = i; |
| 272 | hmput(map,key,i+1); |
| 273 | } |
| 274 | assert(hmlen(map) == b); |
| 275 | for (j=a; j < b; ++j) { |
| 276 | key.n[0] = i-j-1; |
| 277 | hmdel(map,key); |
| 278 | } |
| 279 | assert(hmlen(map) == a); |
| 280 | } |
| 281 | measure(); |
| 282 | hmfree(map); |
| 283 | churn_inserts = i; |
| 284 | churn_deletes = (b-a) * n; |
| 285 | dont_measure(); |
| 286 | } |
| 287 | |
| 288 | typedef struct { int n[32]; } str256; |
| 289 | void churn256(int a, int b, int count, int include_startup) |
no test coverage detected