Robert Roessler wrote:
> Hmmm.  So how did the changes to iterhash.{cpp,h} which I rather you
> hadn't made (since they made my exe larger and are now less clear than
> previously) address this?  And *why* did code size get worse?

Before the changes, a number of template classes in iterhash.h were being 
instantiated into dll.obj. So when you use a hash function, the linker 
brings dll.obj into your .exe. dll.obj references iostream, so the linker 
also brings in iostream (even though it really shouldn't, because it only 
needs the iterhash template functions).

Now, those template classes are instantiated into iterhash.obj, which 
doesn't reference iostream.

I don't understand why it would cause code size to get worse for you. I wish 
the linker had an option that would produce some output explaining which 
pieces of code it's linking in, how big they are, and why (i.e. some kind of 
dependency graph), but it doesn't, so it's not obvious how to debug these 
kinds of issues.

> Something about CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES would be cool
> and a) what it does in general, and b) why does code get smaller if I
> define it on the CLIENT side?  It even reduces some of the extra size
> introduced by the iterhash.{cpp,h} changes - but doesn't get rid of all
> of it.

CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES changes the definitions of a number 
of macros in config.h. When it is not defined, certain templates are not 
instantiated. When it is defined, those same templates are explicitly 
instantiated. If you define it in a .cpp file in your own application, it 
causes those templates to be instantiated into the .obj file compile from 
that .cpp file, so the linker no longer has to look for it in cryptlib.lib. 
I guess that reduces code size because when the linker was linking in the 
templates from cryptlib.lib, it was also linking in other unneeded code.
 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to