Path: utzoo!yunexus!ists!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!usc!ucsd!helios.ee.lbl.gov!nosc!cod!bmarsh From: bmarsh@cod.NOSC.MIL (William C. Marsh) Newsgroups: comp.sys.ibm.pc Subject: Re: Arrays > 64k revisited Message-ID: <1702@cod.NOSC.MIL> Date: 17 Nov 89 23:39:15 GMT Article-I.D.: cod.1702 References: <5860@lindy.Stanford.EDU> Reply-To: bmarsh@cod.nosc.mil.UUCP (William C. Marsh) Organization: Naval Ocean Systems Center, San Diego Lines: 20 In article <5860@lindy.Stanford.EDU> LC.YRS@forsythe.stanford.edu (Richard Stanton) writes: +SOmeone suggested that the Quick C malloc function would work with +arrays > 64k in the huge model. +I wrote a simple test program to try this, using either halloc/hfree +or malloc/free to allocate 100000 bytes, fill them with ASCII 0, +THe program worked fine using halloc. Using malloc, the allocation +seemed to go OK (NULL was not returned), but when the program ended, +I had to reboot as everything I tried to do produced a message +saying I was out of memory. Since malloc() only expects an unsigned, and since 100000 > 65535, malloc() cannot be used to allocate a huge array. halloc() expects a long... Bill Marsh, Naval Ocean Systems Center, San Diego, CA {arpa,mil}net: bmarsh@cod.nosc.mil uucp: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!nosc!bmarsh "If everything seems to be coming your way, you're probably in the wrong lane."