[fpc-devel]Re: fpc-devel digest, Vol 1 #1035 - 2 msgs

Pavel V. Ozerski pavel at insect.mail.iephb.ru
Tue Oct 30 10:15:52 CET 2001

Hello all,

IMHO, there are exists some reason, to make cutting out unused old-style objects methods. An argument for it -
the popularity of KOL (I hoped to port it to FPC but now that seems to be senseless, at least while unused
methods are keeping in executable). I'm not sure that introducing of this feature must cause very big compiler
alteration. Maybe, a possible way would be:
1) for old-style objects: not saving in VMT direct addresses of virtual methods but reserving space (pointer variables)
for every virtual method;
2) at building PASCALMAIN-contained module: creating in initialization code assignments of addresses of used methods
to these placeholders. If methods were not used, theirs placeholders in VMT will remain nil. This way will cause small
slowing down of virtual methods calling, will also increase size of PASCALMAIN-contained module and initialization time
but it can help to essentially reduce size of executables which use old object libraries. I think, 4 bytes for empty placeholder
is better than linked dead code which can be much larger.

I send this idea to weigh it together.

Sincerely, Pavel.

More information about the fpc-devel mailing list