-#if RTE_BITMAP_OPTIMIZATIONS
-
-static inline int
-rte_bsf64(uint64_t slab, uint32_t *pos)
-{
- if (likely(slab == 0)) {
- return 0;
- }
-
- *pos = __builtin_ctzll(slab);
- return 1;
-}
-
-#else
-
-static inline int
-rte_bsf64(uint64_t slab, uint32_t *pos)
-{
- uint64_t mask;
- uint32_t i;
-
- if (likely(slab == 0)) {
- return 0;
- }
-
- for (i = 0, mask = 1; i < RTE_BITMAP_SLAB_BIT_SIZE; i ++, mask <<= 1) {
- if (unlikely(slab & mask)) {
- *pos = i;
- return 1;
- }
- }
-
- return 0;
-}
-
-#endif
-