view doc/alloca-opt.texi @ 6283:b377d8796118

* lib/utimens.c (futimens): Use futimesat if available. Prefer it to futimes since it doesn't have the futimes bug. * m4/utimens.m4 (gl_UTIMENS): Check for futimesat.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 23 Sep 2005 19:18:06 +0000
parents 5a898d7a80a6
children adb21c293305
line wrap: on
line source

@c Documentation of gnulib module 'alloca-opt'.

The alloca-opt module provides for a function alloca() which allocates memory
on the stack, where the system allows it. A memory block allocated with alloca()
exists only until the function that calls alloca() returns or exits abruptly.

There are a few systems where this is not possible: HP-UX systems, and some
other platforms when the C++ compiler is used. On these platforms the alloca-opt
module provides no replacement, just a preprocessor macro HAVE_ALLOCA.

The user can #include <alloca.h> on all platforms, and use alloca() on those
platforms where the preprocessor macro HAVE_ALLOCA evaluates to true. If
HAVE_ALLOCA is false, the code should use a heap-based memory allocation
based on malloc() or - in C++ - 'new'. Note that the #include <alloca.h> must be
the first one after the autoconf-generated config.h. Thanks to AIX for this nice
restriction!