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][BZ #11087] Use atomic operations to track memory


On Thu, 17 Oct 2013, Ondrej Bilka wrote:

> -	if (++mp_.n_mmaps > mp_.max_n_mmaps)
> +	__sync_fetch_and_add (&mp_.n_mmaps, 1);
> +	if (mp_.n_mmaps > mp_.max_n_mmaps)

The __sync_* built-in functions are deprecated in favour of the __atomic_* 
functions (with finer-grained memory model / barrier control) in more 
recent GCC.  You should be using glibc's own macros such as 
atomic_increment and let the architectures determine whether those expand 
to __sync_*, __atomic_* or inline asm.

-- 
Joseph S. Myers
joseph@codesourcery.com


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