summaryrefslogtreecommitdiffstats
path: root/man3/alloca.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/alloca.3')
-rw-r--r--man3/alloca.319
1 files changed, 9 insertions, 10 deletions
diff --git a/man3/alloca.3 b/man3/alloca.3
index 6bf1791..7fa61bc 100644
--- a/man3/alloca.3
+++ b/man3/alloca.3
@@ -13,7 +13,7 @@
.\" Various rewrites and additions (notes on longjmp() and SIGSEGV).
.\" Weaken warning against use of alloca() (as per Debian bug 461100).
.\"
-.TH alloca 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH alloca 3 2023-10-31 "Linux man-pages 6.7"
.SH NAME
alloca \- allocate memory that is automatically freed
.SH LIBRARY
@@ -22,7 +22,7 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <alloca.h>
-.PP
+.P
.BI "void *alloca(size_t " size );
.fi
.SH DESCRIPTION
@@ -54,7 +54,6 @@ T{
.BR alloca ()
T} Thread safety MT-Safe
.TE
-.sp 1
.SH STANDARDS
None.
.SH HISTORY
@@ -73,7 +72,7 @@ it can also simplify memory deallocation in applications that use
or
.BR siglongjmp (3).
Otherwise, its use is discouraged.
-.PP
+.P
Because the space allocated by
.BR alloca ()
is allocated within the stack frame,
@@ -82,19 +81,19 @@ is jumped over by a call to
.BR longjmp (3)
or
.BR siglongjmp (3).
-.PP
+.P
The space allocated by
.BR alloca ()
is
.I not
automatically deallocated if the pointer that refers to it
simply goes out of scope.
-.PP
+.P
Do not attempt to
.BR free (3)
space allocated by
.BR alloca ()!
-.PP
+.P
By necessity,
.BR alloca ()
is a compiler built-in, also known as
@@ -107,12 +106,12 @@ into the built-in, but this is forbidden if standards conformance is requested
in which case
.I <alloca.h>
is required, lest a symbol dependency be emitted.
-.PP
+.P
The fact that
.BR alloca ()
is a built-in means it is impossible to take its address
or to change its behavior by linking with a different library.
-.PP
+.P
Variable length arrays (VLAs) are part of the C99 standard,
optional since C11, and can be used for a similar purpose.
However, they do not port to standard C++, and, being variables,
@@ -125,7 +124,7 @@ would overflow the space available, and, hence, neither is indicating an error.
(However, the program is likely to receive a
.B SIGSEGV
signal if it attempts to access unavailable space.)
-.PP
+.P
On many systems
.BR alloca ()
cannot be used inside the list of arguments of a function call, because