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

Paolo Bonzini bonzini@gnu.org
Sun Feb 15 12:19:00 GMT 2004


> (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




More information about the Gcc mailing list