title: Stack and heap memory of a C program
body: <p>I'm trying to understand the CPU's role in tracking a programs stack/heap allocation.</p>
  
  <p>Reading some material, I've come across this:</p>
  
  <blockquote>
    <p>The stack area traditionally adjoined the heap area and grew the opposite direction; when the stack pointer met the heap pointer, free memory was exhausted.</p>
  </blockquote>
  
  <p>Are the stack and heap pointers stored in program specific registers?</p>
  
  <p>If the stack pointer is pointing to the top of the stack, and (I'm assuming) the heap pointer is pointing to the end of the heap, how would these pointers ever meet without overwriting memory (overflow)?</p>
  
  <p>How does this work in modern systems?</p>