From -5153011158419507000
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,206db806b836bf67
X-Google-Attributes: gidf78e5,public
From: msherman@magma.ca (Marc Sherman)
Subject: Re: Pointers to incomplete type
Date: 1998/01/19
Message-ID: <6a0a4g$rf1@shell.magma.ca>#1/1
X-Deja-AN: 317463650
References: <69osom$jf3@examiner.concentric.net>
X-Original-Date: 19 Jan 1998 14:38:56 -0500
Organization: Magma Communications Ltd., Nepean, Ontario, Canada
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANMPKGeEDnX0m9pzZAQH7EgF8CMYlfsaA09INcx8QR1R4Y8yEWlEfuYRO QE9Rj3VeMduDFlOwABBz92dWK9YwudZM =9A+9
Reply-To: msherman@magmacom.com
Newsgroups: comp.std.c++


In article <69osom$jf3@examiner.concentric.net>,
Bradd W. Szonye <bradds@concentric.net> wrote:
>    Under an alternate object model:
>    1. sizeof(poly) == sizeof(pod)
>    2. sizeof(poly[1000]) == sizeof(pod[1000])
>    3. sizeof(poly *) == 8   // vptr + address
>    4. sizeof(pod *) == 4
>    5. minimum sizeof(vector<T>::iterator) == 4
>    6. minimum sizeof(set<T>::iterator) == 4
>
>Some notes: where I'd expect the big win is in #2: the savings of not
>putting vtable pointers in heavily-allocated, lightweight objects. (Also,

Is case 2 very likely?  Since we're talking about polymorphic objects,
aren't we much more likely to have poly*[1000] than poly[1000]?  If we
have a large array of pointers to poly, your new model would in fact
take up more space than the standard model does.

- Marc
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



