title: Create a heap at a specific memory address for dynamic memory allocation
body: <p>Is there a way to create a heap at a specific memory location (separate from the system heap) that can be used for dynamic memory allocation, but makes use of the dynamic memory allocator built into the C library.</p>
  
  <p>I'm looking for something functionally equivalent to this:</p>
  
  <pre><code>UserHeap heap(startAddress, size);
  
  void* allocatedMemory1 = heap.Allocate(100);  //Allocate 100 bytes.
  void* allocatedMemory2 = heap.Allocate(200);  //Allocate 200 bytes.
  
  /* ... Do seomthing useful with the memory ... */
  
  heap.Free(allocatedMemory1);
  heap.Free(allocatedMemory2);
  </code></pre>
  
  <p>This <a href="http://publib.boulder.ibm.com/infocenter/zvm/v6r2/index.jsp?topic=/com.ibm.zvm.v620.edclv/huheap.htm" rel="nofollow">uheap.h</a> seems to have what I'm looking for, but this doesn't seem to exist in newlib.  I'm wondering if GCC or newlib might have something.  If not I think I may end up porting <a href="http://www.malloc.de/en/" rel="nofollow">ptmalloc</a>.  However, its my understanding that this code is already in the C library and I'd hate to waste the memory reproducing it.</p>
  
  <p>I'm using Sourcery Codebench Lite (GCC) with newlib (C library).</p>