Shrinking exe by removing RTTI

ⅰ亾dé卋堺 提交于 2019-12-03 08:38:23
Giel

Make sure you put the "{$RTTI" line below the "unit unit1;" line.

Note that as of XE5 and newer, this directive needs to be in each individual unit for which you want to disable RTTI. Before that (as in comments, which applies only to XE4 and below) it could be in the DPR file and would apply to all units in the project.

The new RTTI is for Delphi 2010 and up.

It can be removed, but then lots of things will have limited functionality (like JSON conversion, part of DataSnap and many of the newer 3rd party libraries that do ORM or other mappings).

Things depending on TValue are gone anyway.

"old style" RTTI (which was introduced in Delphi 1 and is still present in Delphi 2010) cannot be removed.

So: it is recommended to remove RTTI only from your own units, and not from the RTL and VCL.

--jeroen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!