1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* mm_malloc.h, aligned allocation for the vector intrinsics.
*
* A vector load that names an aligned address faults when the address is not aligned, so a
* program that allocates its own buffers needs a way to ask for one. That is the whole of
* this header. It is two functions and they are not vector operations themselves, which is
* why they live apart from `<xmmintrin.h>` rather than inside it.
*
* Memory from `_mm_malloc` is freed by `_mm_free` and by nothing else. On this target both
* are built on the ordinary allocator, so `free` would work too, but a program that relies
* on that stops working on a target where they are not the same allocator. */
/* Declared here rather than pulled in from `<stdlib.h>`, because a program that includes a
* vector header has not asked for the whole of the standard library and should not get it.
* Both spellings match the ones in `<stdlib.h>`, so including both headers in either order
* is two declarations of the same function and not a conflict. */
extern int ;
extern void *;
extern void ;
/* `__size` bytes aligned to `__align`, or a null pointer if there are not that many.
*
* `posix_memalign` asks for an alignment that is a power of two and at least the width of a
* pointer, and refuses anything else. Both of the adjustments below are there to hand it a
* request it will accept rather than to fail on one it would have refused: an alignment of
* one is no alignment at all and is the plain allocator's job, and an alignment smaller than
* a pointer is already what the plain allocator gives. An alignment that is not a power of
* two is left alone and the failure is reported, since there is no sensible reading of it. */
static __inline__ void *
/* Gives back memory that came from `_mm_malloc`. A null pointer is allowed and does nothing,
* which is `free`'s own rule. */
static __inline__ void