This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]