Thoughts on CPU set manipulation functions

Bert Wesarg bert.wesarg@googlemail.com
Tue Mar 18 12:22:00 GMT 2008


Hi all,

I really appreciate the new CPU set manipulation functions in glibc
2.7 but I think this API isn't complete. Therefore I suggest adding
these additional functions:

* a copy function (which is faster than CPU_OR(dest, src, src))
* the 'd = s1 & ~s2' operator

As a second point I want to suggest to include some kind of iterator
functionality for the API, either as a complete opaque for loop, or a
iterator function pair first_bit_set/next_bit_set.

And finally I have some notes on the names, I found it a little bit
confusing between bits and bytes:

* CPU_SETSIZE is in bits
* all <setsize> arguments to the CPU_*_S macros are in bytes
* CPU_ALLOC_SIZE/CPU_ALLOC uses <count> for number of bits

Comments?

Regards
Bert Wesarg



More information about the Libc-alpha mailing list