I was making a memory pool allocator for a project I am working on. My pool allocator returns chunks of memory fine however my class inherits from another class.
MyClass *fx = (MyClass*)pool->allocateEffect(sizeof(MyClass));
*fx = MyClass();
This doesn't setup the vtable for me. I did some searching and found out the new operator can take in a chunk of memory.
MyClass *fx = (MyClass*)pool->allocateEffect(sizeof(MyClass));
fx = new(fx)MyClass();
And this will initialize the vptr. So I was wondering if there is anyway to allocate the vptr my self or is it strictly up to the compilers whim?