xref: /original-bsd/lib/libc/stdlib/alloca.3 (revision b4971bb3)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)alloca.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt ALLOCA 3
10.Os BSD 4
11.Sh NAME
12.Nm alloca
13.Nd memory allocator
14.Sh SYNOPSIS
15.Fd #include <stdlib.h>
16.Ft void *
17.Fn alloca "size_t size"
18.Sh DESCRIPTION
19The
20.Fn alloca
21function
22allocates
23.Fa size
24bytes of space in the stack frame of the caller.
25This temporary space is automatically freed on
26return.
27.Sh RETURN VALUES
28The
29.Fn alloca
30function returns a pointer to the beginning of the allocated space.
31If the allocation failed, a
32.Dv NULL
33pointer is returned.
34.Sh SEE ALSO
35.Xr brk 2 ,
36.Xr pagesize 2
37.Xr calloc 3 ,
38.Xr malloc 3 ,
39.Xr realloc 3 ,
40.Sh BUGS
41The
42.Fn alloca
43function
44is machine dependent; its use is discouraged.
45.\" .Sh HISTORY
46.\" The
47.\" .Fn alloca
48.\" function appeared in
49.\" .Bx ?? .
50.\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd
51.\" The first man page (or link to a man page that I can find at the
52.\" moment is 4.3...
53