This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Help! cygwin's malloc does not work
- To: nikulin at actsw dot amat dot com
- Subject: Re: Help! cygwin's malloc does not work
- From: DJ Delorie <dj at delorie dot com>
- Date: Mon, 17 Apr 2000 20:20:17 -0400
- CC: cygwin at sourceware dot cygnus dot com
- References: <004e01bfa8bb$23346410$35758798@mis.amat.com>
> Basically, it looks like cygwin can not handle large memory allocations.
Open regedit (or regedt32) and find the key
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\
Create a new DWORD value there called "heap_chunk_in_mb" that contains
the maximum amount of memory (in Mb) your application needs (watch the
hex/decimal toggle). Exit and restart all cygwin applications.
The default is 128 (i.e. 128Mb) if no registry key is set.
Here is a more interesting "max memory" program:
main()
{
unsigned int bit=0x40000000, sum=0;
char *x;
while (bit > 4096) {
x = malloc(bit);
if (x)
sum += bit;
bit >>= 1;
}
printf("%08x bytes (%.1fMb)\n", sum, sum/1024.0/1024.0);
return 0;
}
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com