This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Reducing memory consumption


On Mar 20, 2000, Jeffrey A Law <law@cygnus.com> wrote:

>> So perhaps it is not a good idea to use valloc, then, and instead
>> allocate more than one page at a time using malloc?

> Possibly.  Alexandre has a patch which does this I think

Nope, it just allocates whatever the user expects.  However, it tells
the user to expect a certain overhead, which is how much space
malloc/valloc would need just before the beginning of a page in order
to avoid wasting whole pages with their meta-data.  If it finds valloc
just won't work that way, it falls back to malloc, hoping it does.  If
neither do, it allocates excess space and manages to get an aligned
page in the area it gets from malloc.

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]