annotate lib/alloca.in.h @ 265:68fbca173508 2.6

Added generated files for release
author lost
date Tue, 22 Dec 2009 05:31:23 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
265
68fbca173508 Added generated files for release
lost
parents:
diff changeset
1 /* Memory allocation on the stack.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
2
68fbca173508 Added generated files for release
lost
parents:
diff changeset
3 Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
68fbca173508 Added generated files for release
lost
parents:
diff changeset
4 Foundation, Inc.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
5
68fbca173508 Added generated files for release
lost
parents:
diff changeset
6 This program is free software; you can redistribute it and/or modify it
68fbca173508 Added generated files for release
lost
parents:
diff changeset
7 under the terms of the GNU General Public License as published
68fbca173508 Added generated files for release
lost
parents:
diff changeset
8 by the Free Software Foundation; either version 2, or (at your option)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
9 any later version.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
10
68fbca173508 Added generated files for release
lost
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
68fbca173508 Added generated files for release
lost
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68fbca173508 Added generated files for release
lost
parents:
diff changeset
14 General Public License for more details.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
15
68fbca173508 Added generated files for release
lost
parents:
diff changeset
16 You should have received a copy of the GNU General Public
68fbca173508 Added generated files for release
lost
parents:
diff changeset
17 License along with this program; if not, write to the Free Software
68fbca173508 Added generated files for release
lost
parents:
diff changeset
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
19 USA. */
68fbca173508 Added generated files for release
lost
parents:
diff changeset
20
68fbca173508 Added generated files for release
lost
parents:
diff changeset
21 /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
68fbca173508 Added generated files for release
lost
parents:
diff changeset
22 means there is a real alloca function. */
68fbca173508 Added generated files for release
lost
parents:
diff changeset
23 #ifndef _GL_ALLOCA_H
68fbca173508 Added generated files for release
lost
parents:
diff changeset
24 #define _GL_ALLOCA_H
68fbca173508 Added generated files for release
lost
parents:
diff changeset
25
68fbca173508 Added generated files for release
lost
parents:
diff changeset
26 /* alloca (N) returns a pointer to N bytes of memory
68fbca173508 Added generated files for release
lost
parents:
diff changeset
27 allocated on the stack, which will last until the function returns.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
28 Use of alloca should be avoided:
68fbca173508 Added generated files for release
lost
parents:
diff changeset
29 - inside arguments of function calls - undefined behaviour,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
30 - in inline functions - the allocation may actually last until the
68fbca173508 Added generated files for release
lost
parents:
diff changeset
31 calling function returns,
68fbca173508 Added generated files for release
lost
parents:
diff changeset
32 - for huge N (say, N >= 65536) - you never know how large (or small)
68fbca173508 Added generated files for release
lost
parents:
diff changeset
33 the stack is, and when the stack cannot fulfill the memory allocation
68fbca173508 Added generated files for release
lost
parents:
diff changeset
34 request, the program just crashes.
68fbca173508 Added generated files for release
lost
parents:
diff changeset
35 */
68fbca173508 Added generated files for release
lost
parents:
diff changeset
36
68fbca173508 Added generated files for release
lost
parents:
diff changeset
37 #ifndef alloca
68fbca173508 Added generated files for release
lost
parents:
diff changeset
38 # ifdef __GNUC__
68fbca173508 Added generated files for release
lost
parents:
diff changeset
39 # define alloca __builtin_alloca
68fbca173508 Added generated files for release
lost
parents:
diff changeset
40 # elif defined _AIX
68fbca173508 Added generated files for release
lost
parents:
diff changeset
41 # define alloca __alloca
68fbca173508 Added generated files for release
lost
parents:
diff changeset
42 # elif defined _MSC_VER
68fbca173508 Added generated files for release
lost
parents:
diff changeset
43 # include <malloc.h>
68fbca173508 Added generated files for release
lost
parents:
diff changeset
44 # define alloca _alloca
68fbca173508 Added generated files for release
lost
parents:
diff changeset
45 # elif defined __DECC && defined __VMS
68fbca173508 Added generated files for release
lost
parents:
diff changeset
46 # define alloca __ALLOCA
68fbca173508 Added generated files for release
lost
parents:
diff changeset
47 # else
68fbca173508 Added generated files for release
lost
parents:
diff changeset
48 # include <stddef.h>
68fbca173508 Added generated files for release
lost
parents:
diff changeset
49 # ifdef __cplusplus
68fbca173508 Added generated files for release
lost
parents:
diff changeset
50 extern "C"
68fbca173508 Added generated files for release
lost
parents:
diff changeset
51 # endif
68fbca173508 Added generated files for release
lost
parents:
diff changeset
52 void *alloca (size_t);
68fbca173508 Added generated files for release
lost
parents:
diff changeset
53 # endif
68fbca173508 Added generated files for release
lost
parents:
diff changeset
54 #endif
68fbca173508 Added generated files for release
lost
parents:
diff changeset
55
68fbca173508 Added generated files for release
lost
parents:
diff changeset
56 #endif /* _GL_ALLOCA_H */