[PATCH 02/25] pthread_setaffinity (Linux variant): Rewrite to use VLA instead of alloca

Florian Weimer fweimer@redhat.com
Mon Mar 16 14:30:00 GMT 2015


On 03/02/2015 08:58 PM, Mike Frysinger wrote:
> On 01 Mar 2015 15:05, Florian Weimer wrote:
>> extend_alloca was used to emulate VLA deallocation.
> 
> general note: i found the old code easier to read.  i think GNU style requires 
> newlines after decls and before the return statement.  that would certainly help  
> readability here.

What about this version?  I think it makes the control flow more
explicit, and it prompted me to deal differently with the res == 0 case
(which was swept under the carpet before).

2015-03-16  Florian Weimer  <fweimer@redhat.com>

	* sysdeps/unix/sysv/linux/pthread_setaffinity.c
	(__determine_cpumask_size): Replace extend_alloca with a
	variable-length array.  Always return zero if res == 0.

-- 
Florian Weimer / Red Hat Product Security
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pthread_setaffinity-Linux-variant-Rewrite-to-use-VLA.patch
Type: text/x-patch
Size: 2233 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150316/56d7fb0a/attachment.bin>


More information about the Libc-alpha mailing list