Date: Wed, 4 Jul 2001 12:05:57 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp-workers AT delorie DOT com, Charles Sandmann Subject: Re: malloc() problem, DJDEV 203 In-Reply-To: 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, I 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). Does the following look right? --- malloc.c~0 Wed Jul 4 09:55:04 2001 +++ malloc.c Wed Jul 4 11:10:02 2001 @@ -132,6 +132,16 @@ malloc(size_t size) if (size 0x7fffffff - 0x10000) /* sbrk rounds up to 64KB */ + { + if (__libc_malloc_fail_hook) + __libc_malloc_fail_hook(size); + return 0; + } #if DEBUG printf("malloc(%u)\n", size); #endif