Removing RTTI from binaries

Jens Bauer via D.gnu d.gnu at puremagic.com
Thu Apr 30 07:27:15 PDT 2015


On Friday, 16 January 2015 at 18:37:28 UTC, Johannes Pfau wrote:
> Am Thu, 15 Jan 2015 23:08:57 -0600
> schrieb "Orvid King via D.gnu" <d.gnu at puremagic.com>:
>
> TypeInfo is generated at declaration time. At that point you
> can't even know if a struct will be allocated on the heap at
> some point.

I was wondering... Would it be possible to make selective 
TypeInfo ?
-Eg. Only add TypeInfo for those things that really need it.
If that's possible, then I think the overhead could be decreased 
dramatically.

Another way it could perhaps be reduced, would be to change 
strings into pointers or identifiers. This popped into my mind, 
because it appears that TypeInfo is zero-terminated C-strings 
anyway. If those exist in a read-only memory space, then 
comparing them using strcmp seems quite extraneous; just compare 
the pointer and put some other data there instead; or make a 
32-bit uniqueID (perhaps even a 16-bit UID).


More information about the D.gnu mailing list