1f08c3bdfSopenharmony_citypedef unsigned long int size_t;
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ci/*
4f08c3bdfSopenharmony_ci * The alloc_align attribute is used to tell the compiler that the return
5f08c3bdfSopenharmony_ci * value points to memory, where the returned pointer minimum alignment is given
6f08c3bdfSopenharmony_ci * by one of the functions parameters. GCC uses this information to improve
7f08c3bdfSopenharmony_ci * pointer alignment analysis.
8f08c3bdfSopenharmony_ci *
9f08c3bdfSopenharmony_ci * The function parameter denoting the allocated alignment is specified by one
10f08c3bdfSopenharmony_ci * integer argument, whose number is the argument of the attribute. Argument
11f08c3bdfSopenharmony_ci * numbering starts at one.
12f08c3bdfSopenharmony_ci *
13f08c3bdfSopenharmony_ci * For instance,
14f08c3bdfSopenharmony_ci *
15f08c3bdfSopenharmony_ci *    void* my_memalign(size_t, size_t) __attribute__((alloc_align(1)))
16f08c3bdfSopenharmony_ci *
17f08c3bdfSopenharmony_ci * declares that my_memalign returns memory with minimum alignment given by
18f08c3bdfSopenharmony_ci * parameter 1.
19f08c3bdfSopenharmony_ci */
20f08c3bdfSopenharmony_ci
21f08c3bdfSopenharmony_ci#define __alloc_align(x)  __attribute__((__alloc_align__(x)))
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_ci/*
24f08c3bdfSopenharmony_ci * The aligned_alloc function allocates space for an object whose alignment is
25f08c3bdfSopenharmony_ci * specified by alignment, whose size is specified by size, and whose value is
26f08c3bdfSopenharmony_ci * indeterminate. The value of alignment shall be a valid alignment supported
27f08c3bdfSopenharmony_ci * by the implementation and the value of size shall be an integral multiple
28f08c3bdfSopenharmony_ci * of alignment.
29f08c3bdfSopenharmony_ci *
30f08c3bdfSopenharmony_ci * The aligned_alloc function returns either a null pointer or a pointer to the
31f08c3bdfSopenharmony_ci * allocated space.
32f08c3bdfSopenharmony_ci */
33f08c3bdfSopenharmony_civoid *aligned_alloc(size_t alignment, size_t size) __alloc_align(1);
34f08c3bdfSopenharmony_ci
35f08c3bdfSopenharmony_ci
36f08c3bdfSopenharmony_ci/*
37f08c3bdfSopenharmony_ci * check-name: attribute __alloc_align__
38f08c3bdfSopenharmony_ci */
39