NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/44235: lint1 fails when compiling mesa for sparc



The following reply was made to PR bin/44235; it has been noted by GNATS.

From: "Valeriy E. Ushakov" <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/44235: lint1 fails when compiling mesa for sparc
Date: Mon, 17 Jan 2011 15:10:03 +0300

 On Mon, Jan 17, 2011 at 08:19:09 +0000, David Laight wrote:
 
 > On Mon, Jan 17, 2011 at 02:05:03AM +0000, Valeriy E. Ushakov wrote:
 >
 > > The following reply was made to PR bin/44235; it has been noted by GNATS.
 > > 
 > > From: "Valeriy E. Ushakov" <uwe%stderr.spb.ru@localhost>
 > > Date: Mon, 17 Jan 2011 05:00:25 +0300
 > > 
 > >  xgetblk doesn't check if the next free block it pick up has enough
 > >  space for the allocation.  We come asking for s=41104 bytes, there
 > >  isn't enough space in the current block, so we get one from freelist
 > >  and don't check that it has enough space, so in
 > >  usr.bin/xlint/lint1/mem1.c
 > 
 > Is lint using its own 'malloc' built on top of the system one?
 > Or is something else going on here??
 > 
 > If malloc isn't good enough it should be fixed!
 
 I haven't actually read the code :), but I assume it's written that
 way to simplify memory management.  You can allocate a lot of
 transient objects for some context (e.g. an expression or statement)
 and then do a bulk free on them when your context dies, instead of
 free'ing every one of them (which also requires keeping track of them &c).
 
 -uwe
 


Home | Main Index | Thread Index | Old Index