delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/16/16:11:08

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10205162012.AA13835@clio.rice.edu>
Subject: Re: Malloc/free DJGPP code
To: djgpp-workers AT delorie DOT com
Date: Thu, 16 May 2002 15:12:15 -0500 (CDT)
In-Reply-To: <9464-Thu16May2002223923+0300-eliz@is.elta.co.il> from "Eli Zaretskii" at May 16, 2002 10:39:23 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > From: sandmann AT clio DOT rice DOT edu
> > Date: Thu, 16 May 2002 14:14:16 -0500 (CDT)
> > 
> > So negative arguments only work for the unixy sbrk,
> > or standard sbrk for increments which don't step over a block 
> > boundary.
> 
> You mean, they _could_ work, right?  Because I don't think we do that
> now, even when the Unixy sbrk bit is set.

I should say negative sbrk() does something non-harmful if you are
careful, and the memory can be used by future sbrk()s with positive
values.  This twisted feature is actually used by Quake (my fault) - 
so you could lock all the memory into a single block, then sbrk()
negative some back to give libc some room for malloc to sbrk().
Required to get enough memory on 16-Mb Win95 systems and lock it 
in place in memory so virtual DMA worked.

- Raw text -


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