alloca man page on YellowDog

Man page or keyword search:  
man Server   18644 pages
apropos Keyword Search (all sections)
Output format
YellowDog logo
[printable version]

ALLOCA(3)		   Linux Programmer's Manual		     ALLOCA(3)

NAME
       alloca - memory allocator

SYNOPSIS
       #include <alloca.h>

       void *alloca(size_t size);

DESCRIPTION
       The  alloca() function allocates size bytes of space in the stack frame
       of the caller.  This temporary space is automatically  freed  when  the
       function that called alloca() returns to its caller.

RETURN VALUE
       The  alloca()  function returns a pointer to the beginning of the allo‐
       cated space.  If the allocation causes stack overflow,  program	behav‐
       iour is undefined.

CONFORMING TO
       There  is  evidence  that  the  alloca() function appeared in 32v, pwb,
       pwb.2, 3bsd, and 4bsd.  There is a man page for it  in  4.3BSD.	 Linux
       uses the GNU version.  This function is not in POSIX.1-2001.

NOTES ON THE GNU VERSION
       Normally, gcc translates calls to alloca() by inlined code. This is not
       done when either the -ansi or the -fno-builtin  option  is  given.  But
       beware!	By default the glibc version of <stdlib.h> includes <alloca.h>
       and that contains the line
	      # define alloca(size)   __builtin_alloca (size)
       with messy consequences if one has a private version of this function.

       The fact that the code is inlined, means that it is impossible to  take
       the  address  of	 this  function, or to change its behaviour by linking
       with a different library.

       The inlined code often consists of a single instruction	adjusting  the
       stack  pointer,	and does not check for stack overflow.	Thus, there is
       no NULL error return.

BUGS
       The alloca() function is machine and compiler dependent. On  many  sys‐
       tems its implementation is buggy. Its use is discouraged.

       On many systems alloca() cannot be used inside the list of arguments of
       a function call, because the stack space	 reserved  by  alloca()	 would
       appear  on  the stack in the middle of the space for the function argu‐
       ments.

SEE ALSO
       brk(2), pagesize(2), calloc(3), malloc(3), realloc(3)

GNU				  2002-07-17			     ALLOCA(3)
[top]

List of man pages available for YellowDog

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net