delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/08/03:42:27

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <47D5B138DD8DD311B95100902787500E16F025@cervin.grenoble.cstb.fr>
From: NOE Nicolas <n DOT noe AT cstb DOT fr>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: RE: large memory allocation via new causes segmentation fault in
G++ compiled programs
Date: Tue, 8 Aug 2000 09:35:54 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)

Hello,

I've raised the same problem some time ago on the list. I haven't
seen any answer on the list, but I've found a way to solve it. By the
way, I'm still interested in other people explanations !

Here's my answer, hope it helps !

>>Hello,
>>
>>I'm using cygwin & gcc on a 512 Mb PC running NT, and
>>it seems that I cannot allocate more than (roughly)
>>128 MegaBytes of total memory (either with a single 
>>malloc call, or with lots of them). Is there's a memory 
>>allocation limit in cygwin & gcc or am I missing something ? 
>>
>>(the same program works fine with Watcom C, and I'm using
>>cygwin latest release)
>>
>>Thanks in advance if anyone can help !
>>
>>Nicolas
>
>Hi again,
>
>I can't fully answer my question, but I've found a way to malloc
>more than 128 Mb. I've read than cygwin uses Doug Lea's malloc
>(http://gee.cs.oswego.edu/pub/misc/malloc.c), and I've compiled 
>it and linked it with my programs, and then, it works. 
>
>For instance, the following program fails if compiled with gcc, 
>and works when linked with Doug Lea's malloc.
>
>#include <stdlib.h>
>#include <assert.h>
>
>int main(void)
>{
>	void	*p = malloc(128 * 1024 * 1024);
>	assert(p);
>	return 0;
>}
>
>Using that other malloc solves my problem, but I'd still like to
>know if it's something wrong with my system or a problem with gcc.
>
>Nicolas

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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