.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1980, 1991 Regents of the University of California. .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)alloca.3 5.1 (Berkeley) 5/2/91 .\" .\" Converted Mon Nov 29 11:05:55 1993 by Rik Faith .\" Modified Tue Oct 22 23:41:56 1996 by Eric S. Raymond .\" Modified 2002-07-17, aeb .\" 2008-01-24, mtk: .\" Various rewrites and additions (notes on longjmp() and SIGSEGV). .\" Weaken warning against use of alloca() (as per Debian bug 461100). .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH ALLOCA 3 "6 Marzo 2019" GNU "Manual del Programador de Linux" .SH NOMBRE alloca \- asigna memoria que se libera automáticamente .SH SINOPSIS \fB#include \fP .PP \fBvoid *alloca(size_t \fP\fIsize\fP\fB);\fP .SH DESCRIPCIÓN La función \fBalloca\fP() concede \fIsize\fP bytes de espacio en el marco de pila (stack frame) del invocador. Este espacio temporal se libera automáticamente cuando la función que llamó a \fBalloca\fP() regresa a su invocador. .SH "VALOR DEVUELTO" La función \fBalloca\fP() devuelve un puntero al comienzo del espacio concedido. Si la reserva provoca un desbordamiento de pila, el comportamiento del programa es indefinido. Esta función no se encuentra en POSIX ni SUSv3. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBalloca\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH "CONFORME A" Esta función no está definida en POSIX.1 .PP There is evidence that the \fBalloca\fP() function appeared in 32V, PWB, PWB.2, 3BSD, and 4BSD. There is a man page for it in 4.3BSD. Linux uses the GNU version. .SH NOTAS The \fBalloca\fP() function is machine\- and compiler\-dependent. For certain applications, its use can improve efficiency compared to the use of \fBmalloc\fP(3) plus \fBfree\fP(3). In certain cases, it can also simplify memory deallocation in applications that use \fBlongjmp\fP(3) or \fBsiglongjmp\fP(3). Otherwise, its use is discouraged. .PP Because the space allocated by \fBalloca\fP() is allocated within the stack frame, that space is automatically freed if the function return is jumped over by a call to \fBlongjmp\fP(3) or \fBsiglongjmp\fP(3). .PP The space allocated by \fBalloca\fP() is \fInot\fP automatically deallocated if the pointer that refers to it simply goes out of scope. .PP Do not attempt to \fBfree\fP(3) space allocated by \fBalloca\fP()! .SS "Notas de la versión GNU" Normally, \fBgcc\fP(1) translates calls to \fBalloca\fP() with inlined code. This is not done when either the \fI\-ansi\fP, \fI\-std=c89\fP, \fI\-std=c99\fP, or the \fI\-std=c11\fP option is given \fBand\fP the header \fI\fP is not included. Otherwise, (without an \-ansi or \-std=c* option) the glibc version of \fI\fP includes \fI\fP and that contains the lines: .PP .in +4n .EX #ifdef __GNUC__ #define alloca(size) __builtin_alloca (size) #endif .EE .in .PP lo que puede provocar confusión si se dispone de una versión privada de esta función. .PP El hecho de que el código sea inline, implica que es imposible tomar la dirección de esta función, o cambiar su comportamiento enlazándola con una biblioteca diferente. .PP El código inline consiste a menudo en una sola instrucción ajustando el puntero de pila, y no comprueba un posible desbordamiento de pila. Por tanto, no se devuelve un error NULL. .SH ERRORES There is no error indication if the stack frame cannot be extended. (However, after a failed allocation, the program is likely to receive a \fBSIGSEGV\fP signal if it attempts to access the unallocated space.) .PP En muchos sistemas \fBalloca\fP() no puede ser utilizada dentro de la lista de argumentos de una llamada a función, porque el espacio de pila reservado por \fBalloca\fP() aparecería en mitad del espacio de pila para los argumentos de la función. .SH "VÉASE TAMBIÉN" \fBbrk\fP(2), \fBlongjmp\fP(3), \fBmalloc\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Sebastian Desimone , Gerardo Aburruzaga García , Miguel Pérez Ibars y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .