On 09/29/2013 02:22 PM, Tom Hughes wrote: > Yes. Nothing in the "foo->print()" call actually accesses any memory > that was part of the object. > > The body of the function doesn't access any member variables, and it's > not a virtual function so the vtable is not read, so there is no > access to any freed memory. > > Tom > Thanks to everyone who answered the question but I still do not understand why foo->print() does work. For me foo is part of the object because it is the object. Does it mean that the method print is generated like: void print(Foo *) { std::cout << "foo" << std::endl; }
If this is the case, can someone give me some resources about the memory organisation of c++ and about class/methods generation? Regards, Damien R. ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users