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]
Other format: [Raw text]

Re: RFC: change in std::type_info's equality operator


> (2) t1.__name == t2.__name || strcmp(t1.__name, t2.__name) == 0.
> 
> The library uses version (1) iff the compiler defines __GXX_WEAK__
> to be true.
> 
> My proposal: change the library so it unconditionally uses version 2.
> That is, always fall back to string comparison if the address comparison
>
> The disadvantage: it hurts the performance of anything that uses
> typeinfo comparison where negative comparisons are common.

Would it be possible to store an hash code together with the name and
compare it before the string?  Would it break the ABI?

Paolo



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