This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Thoughts on CPU set manipulation functions
- From: "Bert Wesarg" <bert dot wesarg at googlemail dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 18 Mar 2008 13:21:58 +0100
- Subject: Thoughts on CPU set manipulation functions
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