for a new operator in C ++, there are quite a few people, but I'm interested in placing new.
Suppose you allocated memory in a specific memory location
int memoryPool[poolSize*sizeof(int)];
int* p = new (mem) int;
delete p;
How can I free memory correctly in this case? What if, instead of the int int, I would use some class called myClass?
myClass memoryPool[poolSize*sizeof(myClass )];
myClass * p = new (mem) myClass ;
delete p;
Thank you for your help.
source
share