Path: utzoo!attcan!uunet!jarthur!ucivax!orion.oac.uci.edu!ucsd!ucbvax!pasteur!galileo.berkeley.edu!jbuck From: jbuck@galileo.berkeley.edu (Joe Buck) Newsgroups: comp.object Subject: Re: Shouldn't debuggers be able to debug dynamic objects? Message-ID: <11550@pasteur.Berkeley.EDU> Date: 28 Feb 91 23:53:46 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> Sender: news@pasteur.Berkeley.EDU Reply-To: jbuck@galileo.berkeley.edu (Joe Buck) Distribution: comp Lines: 49 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. Perhaps an implementation could be written this way, but both cfront and g++ use only a single pointer per object, regardless of its class hierarchy. |> In comparison, languages that only include a single pointer to the object's |> class where information allowing message binding is to be found are much |> more minimal in terms of space overhead. You've just described C++ (there is only a single pointer to the object's virtual function table per object in most implementations, and there is only one virtual function table per class). However, since C++ also allows classes with no virtual functions, it's possible to have no overhead at all. !> Nor is this the complete story |> on C++ space overhead. 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. I understand that the goal of these implementation |> practices is greater run-time efficiency, but certainly no one should |> claim they came without price nor that C++ acheives "minimal object |> overhead". Will you actually learn the language before you criticize it? You're stating imaginary requirements and reaching false conclusions. Base classes can be declared as virtual and shared if desired in multiple inheritance hierarchies. Alternatively, there can be duplication if the programmer chooses. All of these "wasted space" arguments you're making are based on misunderstandings of the language. There is no implementation requirement that all superclass variables be continuous. |> I also have considerable problem with C++ I think I'll just cut you off right there. It seems appropriate. :-) C++ certainly has flaws, but you aren't yet competent enough to write about them since your understanding of the language has serious holes. -- Joe Buck jbuck@galileo.berkeley.edu {uunet,ucbvax}!galileo.berkeley.edu!jbuck