From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kenneth Porter" To: "c++-embedded@cygnus.com" , "Michael Bruck" Subject: Re: biggest deterrant to using C++? Date: Tue, 25 Aug 1998 18:04:00 -0000 Message-id: <199808260105.VAA01740@mail1.ispnews.com> X-SW-Source: 1998/msg00030.html 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!)