Date: Fri, 06 Jul 2001 11:22:09 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: Daniel Barker Message-Id: <2593-Fri06Jul2001112207+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (message from Daniel Barker on Fri, 6 Jul 2001 01:12:27 +0100 (BST)) Subject: Re: malloc() problem, DJDEV 203 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> 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 > Newsgroups: comp.os.msdos.djgpp > Date: Fri, 6 Jul 2001 01:12:27 +0100 (BST) > From: Daniel Barker > > 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? It turns out this is next to impossible to do: some DPMI hosts lie about the largest allocation they can satisfy. So in the next release of DJGPP, malloc will fail any attempt to allocate more than 2GB - 64KB + 1 (we subtract 64KB because sbrk rounds up the allocations to the nearest multiple of 64KB, before it asks the DPMI server for more memory).