Overloading new for alignment
Hi. I'm trying to overload my new and delete operators so that they can be created aligned in memory. Basically what I have is:
Code:
void *operator new(size_t size) throw()
{
return _aligned_malloc(size, 16);
}
void operator delete(void *ptr) throw()
{
_aligned_free(ptr);
}
I was wondering if this would stil support object unwinding if I use my version of delete? Also, I am having a hard time compiling because this implementation fights with the new/delete declared in other headers. How would one avoid this type of linker error?