Is there anyone can explain how OOP brings the code bloat to the project? Is there any way to prevent this? puting function in different .obj file can work?
Posted on 2003-05-21 02:43:20 by taowen2002
There was a topic some time ago about using function level linking in masm. That way a function will only be included in the program if it's actually used.

Posted on 2003-05-21 02:55:29 by Thomas
One of my friend told me that the masm32 lib make one function in one obj file, so the unused function will not be linked to the exe file. Is it ture? Can we use the same method to reduce the code bloat brought by OOP?
Posted on 2003-05-21 09:59:53 by taowen2002
Yes that's true, but with some tricks it's also possible to put the functions in one source file and still have function level linking. The trick is to put each function in its own COFF section and set its COMDAT flag. I found the link again:

Posted on 2003-05-21 11:04:12 by Thomas
Thank you very much. And I want to say sorry for my wrong words about your OOP model.
Posted on 2003-05-21 22:20:25 by taowen2002
I made an alternate tool to the link Thomas provided above. The reason is i didnt feel confortable modifying the lib's created. Instead the tool works with how masm was designed to parse/create separarte output files, autmatically complile, and then package into a lib.

Basically it does all the grunt work for you.. you just have to give it the functions you want to add...

Here it is...

Posted on 2003-05-22 16:44:12 by NaN