Date: Wed, 4 Jul 2001 09:30:56 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Matthew Conte cc: djgpp-workers AT delorie DOT com Subject: Re: malloc() problem, DJDEV 203 In-Reply-To: <002901c10421$1423b1c0$e33e1d18@nycap.rr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On Tue, 3 Jul 2001, Matthew Conte wrote: > > If that doesn't work, I think we can safely decline anything above 2GB, > > which will avoid the signed/unsigned nuisance (inside malloc as well). > > careful: sbrk() will accept negative values. Of course, it can: that's how you release memory to the system. (Our `sbrk' doesn't release memory, but it does support negative arguments.) But I don't understand the ``careful'' part: the fact that unsigned values larger than 2GB can be interpreted as negative is _precisely_ the reason I suggested to stop at 2GB (Charles points out that 2GB minus 64KB is a better value). This number cannot be interpreted as a negative one, so where's the problem? Note that I was talking about arguments to `malloc', not to `sbrk', and `malloc' doesn't allow negative arguments. Did you perhaps think that I was suggesting that `sbrk' fails for > 2GB? If so, this is not a problem with `malloc'.