alloca(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

alloca(3c)

Standard C Library Functions                                        alloca(3C)



NAME
       alloca - temporary 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, and returns a pointer to the allocated block. This  tem‐
       porary  space is automatically freed when the caller returns or calls a
       stack frame altering function such as  longjmp(3C).  If  the  allocated
       block extends beyond the current stack limit, the resulting behavior is
       undefined.

RETURN VALUES
       Upon successful completion, alloca() returns a pointer to  space  suit‐
       ably  aligned (after possible pointer coercion) for storage of any type
       of object.


       alloca() may return a pointer to memory which causes a  stack  overflow
       if the full block is accessed.

USAGE
       Memory  allocated  by  this function may be on pages with the PROT_EXEC
       access protections disabled to block execution of machine instructions,
       depending  on  the  system  settings for NXSTACK in sxadm(8) and any -z
       sx=nxstack options that were passed to ld(1) when linking the  applica‐
       tion.  These settings may be overridden for individual pages by calling
       mprotect(2).

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe


SEE ALSO
       brk(2),  getrlimit(2),  mprotect(2), malloc(3C), pthread_attr_getstack‐
       size(2), strdupa(3C), attributes(7)

WARNINGS
       The implementation of alloca() is both machine and compiler  dependent;
       its use is discouraged.


       Undefined  results  will  occur  if the size requested from a process's
       main thread for a block  of  memory  exceeds  the  maximum  size  of  a
       process's  stack,  which  can  be obtained with getrlimit(2); or if the
       size requested from another thread exceeds  the  maximum  size  of  the
       thread stack, which can be obtained with pthread_attr_getstacksize(2).



Oracle Solaris 11.4               23 Jan 2019                       alloca(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3