delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/12/09:55:40

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <9711121456.AA14120@clio.rice.edu>
Subject: Re: malloc()
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Wed, 12 Nov 1997 08:56:38 -0600 (CST)
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.971112144426.20379a-100000@is> from "Eli Zaretskii" at Nov 12, 97 02:46:14 pm

> AFAIK, our `sbrk' doesn't release memory when called with a negative 
> argument.

It does not return memory to DPMI, ever, but a negative sbrk() should
put memory back in the internal sbrk() pool, if I remember correctly.
This feature is useful when using the unixy sbrk to allocate a big
chunk, decrease it's usage, and leave internal extra around so you can
still use near pointers without fear of a single malloc() call someplace
blowing you out.  So, non-release is a feature :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019