vppinfra: use count_trailing_zeros in sparse_vec_index
It is much cheaper to use ctzll than to do shift,subtract and mask
in likely case when we are looking for 1st set bit in the uword.
Change-Id: I31954081571978878c7098bafad0c85a91755fa2
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/svm/svm.c b/src/svm/svm.c
index 16a58fa..e3a734c 100644
--- a/src/svm/svm.c
+++ b/src/svm/svm.c
@@ -83,7 +83,7 @@
unformat_free (&input);
close (fd);
- count_leading_zeros (bits, end);
+ bits = count_leading_zeros (end);
bits = 64 - bits;
if (bits >= 36 && bits <= 48)
return ((1ul << bits) / 4) - (2 * SVM_GLOBAL_REGION_SIZE);