[GiNaC-devel] tinfo

Christian Bauer cb at cebix.net
Wed Nov 30 19:12:08 CET 2005


Jens Vollinga wrote:
> Is it guaranteed that no smart optimizer will merge all static 
> tinfo_static_t into one (there are all the same, aren't they?) with the 
> effect that all tinfo_keys will be the same?

Empty structs/classes have a guaranteed sizeof() > 0 so they won't end 
up at the same address if they are array or struct members, so I guess 
we're a little safer here. I do know, however, that compilers will merge 
string literals (which shouldn't matter since the class names are all 
different...).

In any case, if the pointees are non-const, the compiler can't possibly 
merge the objects since a library user could (in theory) change the 
object through the pointer returned by tinfo().

Bye,
Christian

-- 
   / Physics is an algorithm
\/ www.cebix.net


More information about the GiNaC-devel mailing list