MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / churn8

Function churn8

engine/3rdparty/stb/tests/test_ds_cpp.cpp:319–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319void churn8(int a, int b, int count, int include_startup)
320{
321 struct { size_t key,value; } *map=NULL;
322 int i,j,n,k;
323 for (i=0; i < a; ++i)
324 hmput(map,i,i+1);
325 if (!include_startup)
326 dont_measure();
327 for (n=0; n < count; ++n) {
328 for (j=a; j < b; ++j,++i) {
329 hmput(map,i,i+1);
330 }
331 assert(hmlen(map) == b);
332 for (j=a; j < b; ++j) {
333 k=i-j-1;
334 k = hmdel(map,k);
335 assert(k != 0);
336 }
337 assert(hmlen(map) == a);
338 }
339 measure();
340 hmfree(map);
341 churn_inserts = i;
342 churn_deletes = (b-a) * n;
343 dont_measure();
344}
345
346
347int main(int arg, char **argv)

Callers 1

mainFunction · 0.70

Calls 2

dont_measureFunction · 0.70
measureFunction · 0.70

Tested by

no test coverage detected