This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2][malloc] Use relaxed atomics for malloc have_fastchunks
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "dj at redhat dot com" <dj at redhat dot com>, nd <nd at arm dot com>, <cmetcalf at mellanox dot com>
- Date: Tue, 17 Oct 2017 23:08:34 +0000
- Subject: Re: [PATCH v2][malloc] Use relaxed atomics for malloc have_fastchunks
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0801MB2053F5C639E8EBEE0E90CDB483660@DB6PR0801MB2053.eurprd08.prod.outlook.com>
I think this breaks the build for tilepro. You're using atomic operations
on a bool field, and tilepro only supports atomic operations on 4-byte
objects and gives errors for other sizes. Generic code should only use
atomics on int-size / pointer-size objects unless it knows the particular
architecture supports atomics of other sizes (e.g. through
__HAVE_64B_ATOMICS).
In file included from ../include/atomic.h:50:0,
from malloc.c:216:
malloc.c: In function 'malloc_init_state':
../sysdeps/tile/tilepro/atomic-machine.h:72:7: error: call to '__atomic_error_bad_argument_size' declared with attribute warning: bad sizeof atomic argument [-Werror]
__atomic_error_bad_argument_size (); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sysdeps/tile/tilepro/atomic-machine.h:78:3: note: in expansion of macro '__atomic_update'
__atomic_update ((mem), 0, (newvalue))
^~~~~~~~~~~~~~~
../sysdeps/tile/tilepro/atomic-machine.h:94:40: note: in expansion of macro 'atomic_exchange_acq'
#define atomic_store_relaxed(mem, val) atomic_exchange_acq (mem, val)
^~~~~~~~~~~~~~~~~~~
malloc.c:1818:3: note: in expansion of macro 'atomic_store_relaxed'
atomic_store_relaxed (&av->have_fastchunks, false);
^~~~~~~~~~~~~~~~~~~~
--
Joseph S. Myers
joseph@codesourcery.com