diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2014-10-29 20:32:33 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2014-10-29 20:32:33 -0500 |
commit | 8a27889d505b07d91ecd03ad1cfeb818b9b440f7 (patch) | |
tree | 733e342e932f67aa56b9554b6d901fea129ad578 /rotate.c | |
parent | 40a6ba5c0a5f544bed9c11dc30b751e05a435b1e (diff) |
Add instrumentation
Track the number of comparisons, swaps, and rotations performed in each
part of the sorting algorithm.
Diffstat (limited to 'rotate.c')
-rw-r--r-- | rotate.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,11 +1,14 @@ #include <stddef.h> #include "common.h" +#include "counts.h" /* rotates left */ void rotate(char *base, size_t size, size_t shift) { int dir = 1; + + counts[CURRENT].rotate++; while (shift) { while (2*shift <= size) { swap(base, base + dir*shift, shift); |