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]

Re: [PATCH] Use __builtin_popcount in __sched_cpucount [BZ #21696]


On 07/01/2017 04:12 PM, H.J. Lu wrote:
> posix/sched_cpucount.c assumes that size of __cpu_mask == size of long,
> which is incorrect for x32.  This patch uses __builtin_popcount, which
> is availabe in GCC 4.9, in posix/sched_cpucount.c.
> 
> Tested on i686, x86-64 and x32 with multi-arch disabled.
> 
> 2017-07-01  Florian Weimer  <fweimer@redhat.com>
> 	    H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	[BZ #21696]
> 	* posix/sched_cpucount.c: Don't include <limits.h>.
> 	(__sched_cpucount): Use __builtin_popcount.

Patch looks good to me.  Thanks.

Florian


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