This is the mail archive of the
mailing list for the GCC project.
Re: Advice requested: how big can we be?
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: ghazi at caip dot rutgers dot edu (Kaveh R. Ghazi)
- Cc: aph at redhat dot com, aj at suse dot de, gcc at gcc dot gnu dot org
- Date: Tue, 16 Sep 2003 19:46:27 +0100 (BST)
- Subject: Re: Advice requested: how big can we be?
> > > Then let's add a configure check -
> > How?
> Well to answer your question, write a snippet which uses malloc:
> foo = malloc (512Mb)
> if (!foo)
> return bad;
> memset (foo, 0, 512Mb)
> return good;
> You have to make sure to access the returned memory with memset or
> something. E.g. on some versions of Irix, when you exceed the
> available swap, malloc would return a valid pointer but you'd crash
> when you accessed the memory. See the end of this message:
Some linux kernel / configurations also will crash or crawl to a halt
when you do this - and sometimes the difference between the two is only
the sound of the disk drive.
And even on machines where the test returns meaningful results
(which also depends on the systemwide workload), it is asking
for debugging trouble if you silently generate different libraries
depending on the build system configuration and workload.