comparison gcc/config/i386/gmm_malloc.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Copyright (C) 2004-2018 Free Software Foundation, Inc. 1 /* Copyright (C) 2004-2020 Free Software Foundation, Inc.
2 2
3 This file is part of GCC. 3 This file is part of GCC.
4 4
5 GCC is free software; you can redistribute it and/or modify 5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
23 23
24 #ifndef _MM_MALLOC_H_INCLUDED 24 #ifndef _MM_MALLOC_H_INCLUDED
25 #define _MM_MALLOC_H_INCLUDED 25 #define _MM_MALLOC_H_INCLUDED
26 26
27 #include <stdlib.h> 27 #include <stdlib.h>
28 #if __STDC_HOSTED__
28 #include <errno.h> 29 #include <errno.h>
30 #endif
29 31
30 static __inline__ void * 32 static __inline__ void *
31 _mm_malloc (size_t __size, size_t __align) 33 _mm_malloc (size_t __size, size_t __align)
32 { 34 {
33 void * __malloc_ptr; 35 void * __malloc_ptr;
34 void * __aligned_ptr; 36 void * __aligned_ptr;
35 37
36 /* Error if align is not a power of two. */ 38 /* Error if align is not a power of two. */
37 if (__align & (__align - 1)) 39 if (__align & (__align - 1))
38 { 40 {
41 #if __STDC_HOSTED__
39 errno = EINVAL; 42 errno = EINVAL;
43 #endif
40 return ((void *) 0); 44 return ((void *) 0);
41 } 45 }
42 46
43 if (__size == 0) 47 if (__size == 0)
44 return ((void *) 0); 48 return ((void *) 0);