title: Runtime Memory allocation on stack
body: <p>I want to know about runtime memory allocation on stack area and how its different from runtime memory allocation on Heap area.</p>
  
  <p>I know how memory get allocated by using library function.</p>
  
  <pre><code>#include&lt;alloca.h&gt; void *alloca(size_t size); //(for runtime memory on stack)
  
  #include&lt;stdlib.h&gt; void *malloc(size_t size); //(for run time memory on heap)
  </code></pre>
  
  <p>I also know that if we are using alloca function we don't need to free that memory explicitly because it is associated with stack, its get freed automatically.</p>
  
  <p>I want to know which system calls are associated with alloc and malloc and how they works in both.</p>