Newsgroups: comp.os.msdos.djgpp Date: Fri, 6 Jul 2001 01:12:27 +0100 (BST) From: Daniel Barker To: Subject: Re: malloc() problem, DJDEV 203 In-Reply-To: <200107030107.VAA05731@envy.delorie.com> Message-ID: References: <200107022219 DOT SAA04299 AT envy DOT delorie DOT com> <200107022351 DOT TAA05124 AT envy DOT delorie DOT com> <200107030107 DOT VAA05731 AT envy DOT delorie DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 2 Jul 2001, DJ Delorie wrote: > I wouldn't trust any request bigger than 2G, because you never know > when the OS is going to treat the number like a signed number. sbrk() > is the interface to the OS; has anyone tried testing that > independently of malloc? And has anyone tried testing GNU malloc to > see if it has the same problems? How about if DJGPP malloc() always returned NULL (without even trying) for any allocation request exceeding n bytes, where n is the size of the largest dynamic array one can ever get with DOS/DPMI? This would avoid both problems: rounding 'up' to zero, and any underlying problems above 2 GB. -- Daniel Barker.