c++ link temporary allocations in fuction to custom allocator?
- by user300713
Hi,
I am currently working on some simple custom allocators in c++ which generally works allready. I also overloaded the new/delete operators to allocate memory from my own allocator. Anyways I came across some scenarios where I don't really know where the memory comes from like this:
void myFunc(){
myObj testObj();
....do something with it
}
In this case testObj would only be valid inside the function, but where would its memory come from? Is there anyway I could link it to my allocator? Would I have to create to object using new and delete or is there another way?
Thanks