Make roundf-tests module depend on floorf, ceilf.
[gnulib.git] / doc / alloca.texi
1 @c Documentation of gnulib module 'alloca'.
2
3 @c Copyright (C) 2004 Free Software Foundation, Inc.
4
5 @c Permission is granted to copy, distribute and/or modify this document
6 @c under the terms of the GNU Free Documentation License, Version 1.2 or
7 @c any later version published by the Free Software Foundation; with no
8 @c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
9 @c Texts.  A copy of the license is included in the ``GNU Free
10 @c Documentation License'' file as part of this distribution.
11
12 The alloca module provides for a function alloca() which allocates memory
13 on the stack, where the system allows it. A memory block allocated with alloca()
14 exists only until the function that calls alloca() returns or exits abruptly.
15
16 There are a few systems where this is not possible: HP-UX systems, and some
17 other platforms when the C++ compiler is used. On these platforms the alloca
18 module provides a malloc() based emulation. This emulation will not free a
19 memory block immediately when the calling function returns, but rather will
20 wait until the next alloca() call from a function with the same or a shorter
21 stack length. Thus, in some cases, a few memory blocks will be kept although
22 they are not needed any more.
23
24 The user can #include <alloca.h> and use alloca() on all platforms. Note
25 that the #include <alloca.h> must be the first one after the autoconf-generated
26 config.h. Thanks to AIX for this nice restriction!
27
28 An alternative to this module is the 'alloca-opt' module.