Static arrays problem

BCS ao at
Wed Dec 17 15:04:37 PST 2008

Reply to bearophile,

> BCS:
>> OTOH that could end up large boot times.
> Why? Is a "cleaning loop" with memset (done with modern CPU
> instructions) slower than the loading of a 17 MB executable?
> Bye,
> bearophile

It depends. If the array is not accessed all at once, the OS needs only to 
set up the virtual memory maps and then page fault in the pages as needed. 
If the array is larger than the amount of memory that the OS would like to 
allow the program to keep in memory it could get even worse as it will start 
paging stuff out before the app even gets to main() (OTOH IIRC OPTLINK won't 
allow that big a static array).

More information about the Digitalmars-d mailing list