[Solved] Virtual methods memory usage Java vs C++ [closed]
Your basic assumption is incorrect. The size of the object does not increase with the number of virtual functions. If the class has ANY virtual functions then it has a single pointer to a vtable for that class. The size of the object won’t change beyond that regardless how many virtual functions: struct s0 {}; … Read more