Executable size affected by module count?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Jan 24 15:37:32 PST 2007


Sean Kelly wrote:
> Thomas Kuehne wrote:
>> Every non-trivial module contains (numbers are for Linux)
>> _D5module7__arrayZ
>> 23 bytes code, 19 bytes stringtab, 18 bytes symtab
>>
>> _D5module8__assertFiZv
>> 24 bytes code, 23 bytes stringtab, 18 bytes symtab
> 
> These are the outstanding problem for exposing templates from library 
> code.  And I don't understand why they are generated, since it seems 
> like the code will be identical for each instance generated.  Couldn't 
> they just have a static definition in the runtime?

In their current form they're not identical for each module, for the 
simple reason that the code (after linking) has the reference to the 
module name string hardcoded.
For two extra instructions per call that could be avoided, though at 
that point you might as well just call _d_assert/_d_arraybounds directly 
instead of using an intermediary function...



More information about the Digitalmars-d mailing list