Ref: http://defect.opensolaris.org/bz/show_bug.cgi?id=11552

Hi,

today I noticed this inefficient implementation for the "find first set bit" function:

http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/common/util/ffs.c

efficient implementations already exist under the name of lowbit, e.g. in:

usr/src/uts/sparc/os/bitmap_arch.c
usr/src/uts/intel/ia32/ml/i86_subr.s

Am I missing something here, or could we just #define ffs as lowbit for architectures where sizeof(uintmax_t) == sizeof(ulong_t) ?

Cheers, Nils
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to