From 02033888e15519514c7ad2f45d1b4e901e4df8bd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 17 Oct 2014 05:09:42 +0200 Subject: add alloca MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 2 +- src/alloca.cc | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/alloca.cc diff --git a/Makefile b/Makefile index ec57bed..da0a418 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ .PHONY: all -all: bin/malloc bin/new +all: bin/malloc bin/new bin/alloca bin/%: src/%.cc diff --git a/src/alloca.cc b/src/alloca.cc new file mode 100644 index 0000000..a46c69b --- /dev/null +++ b/src/alloca.cc @@ -0,0 +1,20 @@ +/** + * Copying and distribution of this file, with or without modification, + * are permitted in any medium without royalty provided the copyright + * notice and this notice are preserved. This file is offered as-is, + * without any warranty. + */ +#include +#include + +int main(void) +{ + char* a; + size_t i; + + for (i = 0; i < 40000000UL; i++) + a = (char*)alloca(16); + + return 0; +} + -- cgit v1.2.3-70-g09d2