Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!gordon From: John Gordon Newsgroups: comp.lang.c Subject: Re: Failing Malloc Date: Wed, 12 Sep 2012 20:55:09 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 18 Message-ID: References: NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1347483309 9634 166.84.1.2 (12 Sep 2012 20:55:09 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 12 Sep 2012 20:55:09 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.c:26258 In Eric writes: > Sorry maybe I wasn't too clear. I would like to get the Malloc call to > succeed if I redo it. Or get some alternative memory eg from the stack or > swop. If malloc is returning null, there isn't a lot you can do. You can wait a short interval and pray that more memory becomes available (perhaps some other program just exited, freeing up a lot of memory.) You can free some memory that your program is using elsewhere. -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"