This is the mail archive of the c++-embedded@sourceware.cygnus.com mailing list .


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

template bloat


Many of us, I'm sure, avoid templates because they often generate
identical code differentiated only by parameter types, but not by the
final binary. This usually happens where the template parameter is a
pointer and the template doesn't dereference the pointer. For example,
an STL container of pointers will suffer from this effect.

It would be nice if the tool chain could identify these situations and
merge templates that are binary-equivalent. One way to do this is to
assign a checksum to every routine in the compiler and have the linker
look for routines with the same checksum. These can then be further
examined to see if the code is identical and can then be merged.

For debugging, the feature could be disabled for all routines that
don't share common source (ie. non-templates).

Ken
mailto:shiva@well.com
http://www.well.com/user/shiva/

http://www.e-scrub.com/cgi-bin/wpoison/wpoison.cgi (Death to Spam!)



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