I am trying to understand how defining a function as a friend function
impact its placement in memory (RAM).
For example, each class has a table of all of its methods and functions. Also, virtual functions are placed in the vtable
.
Where does friend
functions belong?
The reason I'm concerned, is due to a [recursion] function that has been invoked a large number of times via multiple threads in my c++ code, and eventually I'm getting "v'table corruption runtime exception". which is a sign of memory corruption (as I saw here for example).
Also, when declaring this function as a regular outside-of-class function, the exception persists.
When declaring that function to be friend
however (it's a bad design, but for the sake of experiment), that exception no longer pops-up.
Therefor my question about friend functions' memory location.