#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>

#define KB 1024

int main() {
  long count = 0;
  uintptr_t *ptr;

  while(1) {
    ptr = alloca((size_t)KB);
    if (!ptr) break;
    
    printf("Allocated %ld KB on the stack, got address %p\n",
	++count,(void*)ptr); 
  }
  return 0;
}

