title: How does alloca() work on a memory level?
body: <p>I'm trying to figure out how <code>alloca()</code> actually works on a memory level. From the <a href="https://man7.org/linux/man-pages/man3/alloca.3.html" rel="noreferrer">linux man page</a>:</p>
  <blockquote>
  <p>The alloca() function allocates size bytes of space in the stack
  frame of the caller.  This temporary space is automatically freed
  when the function that called alloca() returns to its caller.</p>
  </blockquote>
  <p>Does this mean <code>alloca()</code> will forward the stack pointer by <code>n</code> bytes? Or where exactly is the newly created memory allocated?</p>
  <p>And isn't this exactly the same as <a href="https://de.wikipedia.org/wiki/Variable_Length_Array" rel="noreferrer">variable length arrays</a>?</p>
  <p>I know the implementation details are probably left to the OS and stuff. But I want to know how <em>in general</em> this is accomplished.</p>