VLA
public c v1 · immutable#include <stdio.h>#include <stdlib.h>#include <alloca.h>void foo_alloca(size_t s);void foo_vla(size_t s);intmain(int argc, char* argv[]){ size_t s = 1024 * 1024 * 1024; foo_vla(s); foo_alloca(s); return 0;}voidfoo_alloca(size_t s){ size_t j; int* i = (int *) alloca(s); for (j = 0; j < s; j++) i[j] = j;}voidfoo_vla(size_t s){ size_t j; int i[s]; for (j = 0; j < s; j++) i[j] = j;}