title: C++ STL with jemalloc
body: <p>How is it possible to use C++ STL containers with jemalloc (or any other <code>malloc</code> implementation)?</p>
  
  <p>Is it as simple as include <code>jemalloc/jemalloc.h</code>? Or should I write an allocator for them?</p>
  
  <p><strong>Edit</strong>: The application I'm working on allocates and frees relatively small objects over its lifetime. I want the replace the default allocator, because benchmarks showed that the application doesn't scale beyond 2 cores. Profiling showed that it was waiting for memory allocation, that's what caused the scaling issues. As I understand, <code>jemalloc</code> will help with that.</p>
  
  <hr>
  
  <p>I'd like to see a solution, that's platform-neutral as the application has to work on both Linux and Windows. (Linking against a different implementation is easy under Linux, but it's very hard on Windows as far as I know.)</p>