title: Why does Windows have 5-7 different memory allocation routines?
body: <p>According to their <a href="https://docs.microsoft.com/en-us/windows/desktop/memory/comparing-memory-allocation-methods" rel="nofollow noreferrer">documentation</a>, Windows has a plethora of memory allocation functions.</p>
  
  <ul>
  <li>CoTaskMemAlloc</li>
  <li>GlobalAlloc</li>
  <li>HeapAlloc</li>
  <li>LocalAlloc</li>
  <li>malloc</li>
  <li>new</li>
  <li>VirtualAlloc</li>
  </ul>
  
  <p>Considering that "the different heap allocators provide distinctive functionality by using different mechanisms, you must free memory with the correct function," what advantage is their to having these various routines?</p>
  
  <p>Is there some historical reason why the list of allocation routines grew?</p>