Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!rutgers!mailrus!ncar!tank!uwvax!dogie!yahnke@vms.macc.wisc.edu From: yahnke@vms.macc.wisc.edu (Ross Yahnke, MACC) Newsgroups: comp.sys.mac.programmer Subject: Re: Allocating large amounts of memory Message-ID: <1120@dogie.edu> Date: 20 Jan 89 14:15:20 GMT Sender: news@dogie.edu Organization: University of Wisconsin Academic Computing Center Lines: 18 In article <9154@cit-vax.Caltech.Edu>, janin@tybalt.caltech.edu (Adam L. Janin) writes... >I am having a problem allocating large amounts of memory in LightSpeed C. >I want to allocate a relocatable block which is larger than 32k. I get >out of memory errors when I try... There's no obvious reason you should have a problem doing this, HOWEVER... are you sure you're passing a long to NewHandle? If you're passing something that evals to a 1 word int, and it is larger than 32K, it will really be negative. If you then cast it to a long, it will be an immensely large number guarenteed to cause NewHandle to fail. Or something like that, hope you catch my drift... /////////////////////////////////////////////////////////////////////////// Internet: yahnke@vms.macc.wisc.edu | Everyone's happy, they're finally Bitnet: yahnke@wiscmacc(.bitnet) | all the same, cuz everyone's jumping Phonenet: (608) 262-8626 | everybody elses train. --R. Smith \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\