home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,471 of 33,346   
   Marc to Marc   
   Re: ABI of passing empty classes by valu   
   16 Sep 11 19:40:26   
   
   From: marc.glisse@gmail.com   
      
   Marc  wrote:   
      
   > In C++, it is fairly common to pass functions an extra argument that   
   > is used purely for dispatching purposes (or at least type   
   > information), from a tag class that doesn't have any content.   
   [...]   
   > Now in all ABIs I have seen, since sizeof(Tag)==1, an object of size 1   
   > is copied, put on the stack (or in a register), etc, and nothing takes   
   > advantage of the fact that it could be implemented as a function with   
   > 1 fewer argument   
      
   I just found out that the "Itanium C++ ABI" (used by a large   
   proportion of C++ compilers) almost had this optimization thanks to   
   SGI, but then gcc and HP had some (unspecified) difficulty and it was   
   removed :-(   
      
   http://sourcery.mentor.com/public/cxx-abi/cxx-closed.html   
   issue A-5.   
      
   Obviously an ABI, like any standard, is a compromise that won't   
   satisfy everyone perfectly...   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca