diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-01-11 23:19:31 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-01-11 23:19:31 +0000 |
commit | 79a399c05ab3ee9575c964727c9aea59ee65dae6 (patch) | |
tree | 35a3c9ea045eeb11916d7e2ef0ac931263c42fc1 /src/include/alloca.h | |
parent | f31d91bce5b143724e1900ac33b348a2c192e80b (diff) | |
download | ipxe-79a399c05ab3ee9575c964727c9aea59ee65dae6.tar.gz |
alloca() can be useful in some (limited) circumstances.
Diffstat (limited to 'src/include/alloca.h')
-rw-r--r-- | src/include/alloca.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/include/alloca.h b/src/include/alloca.h new file mode 100644 index 000000000..08398fb3b --- /dev/null +++ b/src/include/alloca.h @@ -0,0 +1,25 @@ +#ifndef _ALLOCA_H +#define _ALLOCA_H + +/** + * @file + * + * Temporary memory allocation + * + */ + +#include <stdint.h> + +/** + * 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 */ |