From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP and NT Alpha Date: Wed, 31 Dec 1997 16:23:29 -0600 Organization: Southwest Missouri State University Lines: 27 Message-ID: <34AAC5E1.1648@nic.smsu.edu> References: <68e6c5$53g AT crcnis3 DOT unl DOT edu> Reply-To: aho450s AT nic DOT smsu DOT edu NNTP-Posting-Host: marie.a39.smsu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Jeffrey N Woodford wrote: > > DPMI memory available: 13943 Kb > DPMI swap space available: 0 Kb > > Is my lack of swap space the reason why it won't run these "large" programs? > > I tried this simple program and the pointer d returned NULL. Is my > program unreasonable? Is there an example program or something that I > could try to see if the compiler is working correctly? > > #include > #include > > int main (void) > { > double *d; > > d = (double *) malloc (4000000 * sizeof (double)); > if (d == NULL) printf ("d is null!\n"); > else free(d); > return (0); > } You have approximately 13M of available DPMI memory and no swap space, but you're trying to allocate about 32M of memory (4,000,000 * 8). That's why malloc is returning NULL.