Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ames!pacbell.com!pacbell!m5!tma From: tma@m5.COM (Tim Atkins) Newsgroups: comp.object Subject: Re: Shouldn't debuggers be able to debug dynamic objects? Message-ID: <4684@m5.COM> Date: 23 Mar 91 02:42:35 GMT References: <1991Jan24.152256.24273@resam.dk> <1991Jan25.145947.16431@bellcore.bellcore.com> <1991Jan28.100213.1822@resam.dk> <1991Jan28.151241.25449@bellcore.bellcore.com> <40541@genrad.UUCP> <4578@m5.COM> <1991Mar2.052423.3231@objy.com> Reply-To: tma@m5.UUCP (Tim Atkins) Distribution: comp Organization: Object Sciences Corp., Menlo Park, CA Lines: 54 In article <1991Mar2.052423.3231@objy.com> peter@objy.com writes: >In article <4578@m5.COM>, tma@m5.COM (Tim Atkins) writes: >|> I fail to understand the phrase "minimal object overhead" regarding >|> C++. Surely such can not be claimed in terms of space. If one cares >|> about issues of polymorphism for a given set of classes then each instance >|> will contain an overhead of at least a 4 byte virtual table pointer for >|> every class in its inheritance hierarchy than defines virtual functions. > >You are mistaking features of one particular implementation of C++ with >features of the language itself. Virtual tables (vtbls for short) ARE >NOT PART OF THE LANGUAGE. They are merely one way of implementing the >virtual function behavior of the language. True enough. I am not mistaken implementation for language however. I am merely referring to the nearest thing to a "standard" we have today, namely Cfront from ATT. Unless things have changed radically in later versions what I wrote also applies to g++, as I remember it. These two implementations unfortunately seem to cover the majority of workstation users I find posts from on comp.lang.c++ . I'm not sure about how Borland or Zortech do things or other companies do things. I would be very pleased if someone would enlighten me on alternate strategies that are *market realities*. It is no big challenge merely to think of alternate stratgies. > >Secondly, the particular implementation you are probably refering to, >cfront from ATT, does NOT have a vtbl pointer for every super class >that has virtual functions. In the single inheritance case, there is >atmost one vtbl pointer no matter how many classes in the inheritance >chain have virtual functions. Multiple inheritance is more >complicated. False, or at best only partially correct. Pre version 2.0 when there was no MI you are correct. After 2.0 even hierarchies with no multiple inheritance will have multiple vtbl pointers, one for each class in the hierarchy that defines new virtual functions. > >|> Due to the way MI is implemented in relation to >|> the implementation requirement that all superclass variables be contiquous, >|> it is quite possible that there is duplication of entire substructures >|> in the C++ instance. > >Again, this is NOT A CHARACTERISTIC of the langauge. The people at Tau Metric >and Oregon Software would probably be glad to tell you about how their compiler >doesn't make any redundant copies of base classes. I would love to hear more about how these and other companies do things. But do note that I did not say these latter things are language features. I specifically tied it to particular implementation practices in at least two places shown in the quoted material. - Tim Atkins