MCPcopy Create free account
hub / github.com/F-Stack/f-stack / highbit64

Function highbit64

freebsd/contrib/openzfs/lib/libzpool/kernel.c:703–710  ·  view source on GitHub ↗

* Find highest one bit set. * Returns bit number + 1 of highest bit that is set, otherwise returns 0. * The __builtin_clzll() function is supported by both GCC and Clang. */

Source from the content-addressed store, hash-verified

701 * The __builtin_clzll() function is supported by both GCC and Clang.
702 */
703int
704highbit64(uint64_t i)
705{
706 if (i == 0)
707 return (0);
708
709 return (NBBY * sizeof (uint64_t) - __builtin_clzll(i));
710}
711
712/*
713 * Find lowest one bit set.

Callers 15

zfs_extendFunction · 0.50
vdev_disk_openFunction · 0.50
zfs_extendFunction · 0.50
zfs_create_fsFunction · 0.50
zfsvfs_create_implFunction · 0.50
abd_alloc_chunksFunction · 0.50
range_tree_stat_verifyFunction · 0.50
range_tree_stat_incrFunction · 0.50
range_tree_stat_decrFunction · 0.50
zap_leaf_byteswapFunction · 0.50
zap_leaf_initFunction · 0.50
metaslab_df_allocFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected