Subject: Re: I get a core when I malloc 1.5 Megs of memory, why?
To: None <johnam@datastorm.com>
From: Mike Long <mike.long@analog.com>
List: netbsd-help
Date: 07/23/1996 15:59:51
>From: John Maier <johnam@datastorm.com>
>Date: Tue, 23 Jul 1996 09:24:30 -0500
>
>I need to allocate 1,545,000 bytes of memory for an array of structures.  I have enough memory, 64 Megs worth, on my i386 running 1.1.
>
>I have tried using calloc and malloc and when I run the final app, it core dumps.
>
>Get ready, now when I run it under xxgdb or just gbd it works!  Executes, process the data, everything!!!
>
>So what's up?

You need to check the value returned by [mc]alloc().  If it's NULL,
your code should punt.

See also: limit(1).
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil