图中红色框是读书时的疑点(因为会上人员大都读过陈皓的C++ 虚函数表解析,也做了实验证明,大家了解到目前microsoft的编译器是不会将Base2::mumble()放大那个位置的.)
如果(对C++中虚表不太了解)
{
可以参考:陈皓专栏:http://blog.csdn.net/haoel/archive/2007/12/18/1948051.aspx
}
书中讲到关于编译器为支持多重继承下的虚函数的传统做法:
翻译如下:
后来看了一下英文版:对应段落如下:
With the advent of runtime linkers in support of dynamic shared libraries, the linking of symbolic names can be extremely slow梪p to 1 ms per name, for example, on a SparcStation 10. To better accommodate the performance of the runtime linker, the Sun compiler concatenates the multi-ple virtual tables into one. The pointers to the secondary virtual tables are generated by adding an offset to the name of the primary table. Under this strategy, each class has only one named virtual table. "For code used on a number of Sun projects [the speedup] was quite noticeable.
看完以后恍然大悟.
连锁一词用的不好, 连接更合适.
另外"连锁为一个"后的冒号改为句号更合适一些,更易懂一些.
====================================
读书会回忆:怪不得今天LT跟SGG说暗语大家听不懂.暗语大概如下:
LT:"是冒号还是逗号?"
SGG:"是句号".
XY:"枯藤老树昏鸦, 小桥流水人家".
No comments:
Post a Comment