Jonathan Wakely
8a9a593115
Add alloc_align attribute to memalign et al
...
GCC 4.9.0 added the alloc_align attribute to say that a function
argument specifies the alignment of the returned pointer. Clang supports
the attribute too. Using the attribute can allow a compiler to generate
better code if it knows the returned pointer has a minimum alignment.
See https://gcc.gnu.org/PR60092 for more details.
GCC implicitly knows the semantics of aligned_alloc and posix_memalign,
but not the obsolete memalign. As a result, GCC generates worse code
when memalign is used, compared to aligned_alloc. Clang knows about
aligned_alloc and memalign, but not posix_memalign.
This change adds a new __attribute_alloc_align__ macro to <sys/cdefs.h>
and then uses it on memalign (where it helps GCC) and aligned_alloc
(where GCC and Clang already know the semantics, but it doesn't hurt)
and xposix_memalign. It can't be used on posix_memalign because that
doesn't return a pointer (the allocated pointer is returned via a void**
parameter instead).
Unlike the alloc_size attribute, alloc_align only allows a single
argument. That means the new __attribute_alloc_align__ macro doesn't
really need to be used with double parentheses to protect a comma
between its arguments. For consistency with __attribute_alloc_size__
this patch defines it the same way, so that double parentheses are
required.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-10-21 00:19:20 +01:00
..
2021-10-20 18:12:41 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-07-09 20:09:14 +02:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-05 11:33:16 -03:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-03-29 21:41:09 +02:00
2021-07-28 13:55:42 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-05-14 11:36:40 -03:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-06-03 09:11:45 +02:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-05-06 11:01:05 -06:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-10-21 00:19:20 +01:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-07-09 15:10:35 -07:00
2021-01-02 12:17:34 -08:00
2021-01-05 11:33:16 -03:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-05-14 11:36:40 -03:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-08-04 15:33:21 -04:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-10-20 12:01:40 -03:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-05-16 15:21:18 -06:00
2021-04-12 19:03:19 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-10-05 14:25:40 +00:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2020-06-30 23:04:06 +00:00
2020-06-30 23:04:06 +00:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30
2021-01-02 12:17:34 -08:00
2021-07-08 18:47:21 +05:30
2021-01-02 12:17:34 -08:00
2021-01-02 12:17:34 -08:00
2021-09-03 22:06:44 +05:30