2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
5 System header file <alloca.h>
11 #include <sys/cdefs.h>
14 /* Discard any previous definition. */
19 /* Allocate a block of memory which will be automatically freed upon function exiting. */
20 extern void *alloca(size_t size
);
22 /* Private function to get the upper or lower bound (depending on the architecture)
24 extern void *__alloca_get_stack_limit(void);
27 /* GNU C provides a builtin alloca function. */
29 # if AROS_STACK_GROWS_DOWNWARDS
30 # define alloca(size) \
32 ((void *)(AROS_GET_SP - AROS_ALIGN(size)) <= __alloca_get_stack_limit()) ? \
34 __builtin_alloca(size); \
37 # define alloca(size) \
39 ((void *)(AROS_GET_SP + AROS_ALIGN(size)) >= __alloca_get_stack_limit()) ? \
41 __builtin_alloca(size); \
43 # endif /* AROS_STACK_GROWS_DOWNWARDS */