From: Michael Brown Date: Thu, 11 Jan 2007 23:19:31 +0000 (+0000) Subject: alloca() can be useful in some (limited) circumstances. X-Git-Tag: mcb-xen-demo~106 X-Git-Url: http://git.etherboot.org/people/xl0/gpxe.git/commitdiff_plain/79a399c05ab3ee9575c964727c9aea59ee65dae6 alloca() can be useful in some (limited) circumstances. --- diff --git a/src/include/alloca.h b/src/include/alloca.h new file mode 100644 index 00000000..08398fb3 --- /dev/null +++ b/src/include/alloca.h @@ -0,0 +1,25 @@ +#ifndef _ALLOCA_H +#define _ALLOCA_H + +/** + * @file + * + * Temporary memory allocation + * + */ + +#include + +/** + * Allocate temporary memory from the stack + * + * @v size Size to allocate + * @ret ptr Allocated memory + * + * This memory will be freed automatically when the containing + * function returns. There are several caveats regarding use of + * alloca(); use it only if you already know what they are. + */ +#define alloca(size) __builtin_alloca ( size ) + +#endif /* _ALLOCA_H */