I have written own memory library which helps me to avoid memory leaks and to avoid fragmentation problems. All works fine. The main problem is it doesn’t work valid with classes. When i call my_alloc(size) i want to automatically call constructor if it exists. Can i do it without overloading new operator?
Share
You can use placement new on your allocated memory, to invoke the constructor without letting
newdo the allocations.What’s wrong with overloading
new?