This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Advice requested: how big can we be?
> > > Is this unreasonable? Should we be able to build on boxes with
> > > less swap than that? Or shall we just say "512M swap or don't
> > > bother building libgcj" ?
> >
> > 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:
http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
Having said all that, I'm ambivalent about whether doing this is a
good thing.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu