expressions: make assign_expression() take an op argument
[smatch.git] / validation / alloc-align.c
blobe414257aa54ae26c8759fdc96ab25863dfc81a58
1 typedef unsigned long int size_t;
3 /*
4 * The alloc_align attribute is used to tell the compiler that the return
5 * value points to memory, where the returned pointer minimum alignment is given
6 * by one of the functions parameters. GCC uses this information to improve
7 * pointer alignment analysis.
9 * The function parameter denoting the allocated alignment is specified by one
10 * integer argument, whose number is the argument of the attribute. Argument
11 * numbering starts at one.
13 * For instance,
15 * void* my_memalign(size_t, size_t) __attribute__((alloc_align(1)))
17 * declares that my_memalign returns memory with minimum alignment given by
18 * parameter 1.
21 #define __alloc_align(x) __attribute__((__alloc_align__(x)))
24 * The aligned_alloc function allocates space for an object whose alignment is
25 * specified by alignment, whose size is specified by size, and whose value is
26 * indeterminate. The value of alignment shall be a valid alignment supported
27 * by the implementation and the value of size shall be an integral multiple
28 * of alignment.
30 * The aligned_alloc function returns either a null pointer or a pointer to the
31 * allocated space.
33 void *aligned_alloc(size_t alignment, size_t size) __alloc_align(1);
37 * check-name: attribute __alloc_align__