This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: EGCS: pointer to member functions.


> Opinions?

Generating pointer-to-member thunks for all member functions seems
like a big overhead to me. In my experience, pointer-to-members are
infrequently used, not justifying the overhead. But then, I thought
that virtual bases are also infrequently used, until I saw the CORBA
Objects-by-value mapping ...

I'll throw some other alternatives into the discussion:

1. the thunk could receive another implicit parameter, which is the
   type_info of the static type of the target object. It could then
   cast this to the right type, and invoke the target method.

2. if code size is the problem, we don't have to do the
   pointer-to-member evaluation inline. It could be a libgcc
   function.  If course, that would not improve speed, only size -
   perhaps done with -Os only.
  
Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]