This is the mail archive of the
c++-embedded@sourceware.cygnus.com
mailing list .
Re: biggest deterrant to using C++?
- To: "c++-embedded at cygnus dot com" <c++-embedded at cygnus dot com>, "Michael Bruck" <mbruck at rft dot de>
- Subject: Re: biggest deterrant to using C++?
- From: "Kenneth Porter" <shiva at well dot com>
- Date: Tue, 25 Aug 1998 18:04:02 +0700
- Reply-To: "Kenneth Porter" <shiva at well dot com>
On Tue, 25 Aug 1998 20:53:39 +0200, Michael Bruck wrote:
>You waste the space for the pointer (Thing::data). This is ok
>if you have big classes (many values). But if you have two or
>three bytes per class this is unacceptable. It also doesn't
>make your programs easier to read (ok, with a 40KB
>macro-header :)
Small classes with virtual methods just don't ROM effectively. Related
question: Do compilers put the vtable in the text segment so that it
can be ROM'd?
The case where I was asking the question involved a big command table
with fixed-size string buffers for each command and a series of flag
bytes. I currently build this in assembler and use a C routine to scan
the tables. Assembler is used because the tables have 26 internal
labels to allow quick jumping to command entries starting with a
specific character. (I inherited this design. In retrospect I could use
26 independent tables or use binary search, since the entries are of
fixed size.) Obviously this is the kind of bulky data that could
benefit from the architecture I described.
Ken
mailto:shiva@well.com
http://www.well.com/user/shiva/
http://www.e-scrub.com/cgi-bin/wpoison/wpoison.cgi (Death to Spam!)
Ken
mailto:shiva@well.com
http://www.well.com/user/shiva/
http://www.e-scrub.com/cgi-bin/wpoison/wpoison.cgi (Death to Spam!)