title: operator new overloading and alignment
body: <p>I'm overloading <code>operator new</code>, but I recently hit a problem with alignment. Basically, I have a class <code>IBase</code> which provides <code>operator new</code> and <code>delete</code> in all required variants. All classes derive from <code>IBase</code> and hence also use the custom allocators.</p>
  
  <p>The problem I'm facing now is that I have a child <code>Foo</code> which has to be 16-byte aligned, while all others are fine when aligned to 8-byte. My memory allocator however aligns to 8-byte boundaries only by default, so now the code in <code>IBase::operator new</code> returns an unusable piece of memory. How is this supposed to be solved correctly?</p>
  
  <p>I can simply force all allocations to 16 bytes, which will work fine until a 32-byte aligned type pops up. Figuring out the alignment inside <code>operator new</code> doesn't seem to be trivial (can I do a virtual function call there to obtain the actual alignment?) What's the recommended way to handle this?</p>
  
  <p>I know <code>malloc</code> is supposed to return a piece of memory which is suitably aligned for everything, unfortunately, this "everything" doesn't include SSE types and I'd really like to get this working without requiring the user to remember which type has which alignment.</p>