Mail Archives: djgpp-workers/2002/05/16/19:04:38
Eli Zaretskii wrote:
>
> > Date: Thu, 16 May 2002 11:49:02 -0400
> > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > >
> > > Our sbrk cannot return memory to the system, so no problems can ever
> > > arise out of that ;-)
> >
> > It cannot be told to supply a negative increment, thus reducing
> > the portion supplied (question, not statement)?
>
> The DJGPP implementation of sbrk does accept a negative argument, but
> it doesn't return that memory to the system.
So, what does it do with that memory. Is it simply abandoned?
What does it do if the argument is the negative of the total size
allocated continuously so far? What if the negative argument is
larger magnitude that what has been allocated? What happens on a
subsequent call for a normal positive size? If these things can
foul it up nmalloc should protect against generating such calls
with oversized requests. Maybe it could limit allocation requests
to INT_MAX after rounding up.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
- Raw text -