Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bbn!ginosko!cg-atla!fredex From: fredex@cg-atla.UUCP (Fred Smith) Newsgroups: comp.sys.ibm.pc Subject: Re: Looking for a decent C compiler Message-ID: <7272@cg-atla.UUCP> Date: 22 Jun 89 16:59:12 GMT References: <3741@udccvax1.acs.udel.EDU> <1440@bucket.UUCP> <1989Jun17.081153.19335@ziebmef.uucp> Reply-To: fredex@cg-atla.UUCP (Fred Smith) Organization: Agfa Compugraphic Division Lines: 29 In article <1989Jun17.081153.19335@ziebmef.uucp> mdfreed@ziebmef.UUCP (Mark Freedman) writes: > >(if you're running MS-DOS, you *can't* get around the 64k structure limit) > > I thought that one could dynamically allocate objects larger than 64K in the >HUGE memory model, or by using HUGE pointers. According to the reference for >Turbo C 2.0, farmalloc() can allocate blocks larger than 64K (from the far heap) >. I don't have Microsoft C, but I suspect that it is similar (except for the >bugs introduced by the optimizer :-)). In Microsoft C HUGE space can be allocated with _halloc(). I believe that the MS documentation says that in HUGE model that malloc() is mapped to _halloc(). You can also explicitly declare a variable as a pointer to a huge object, then initialize it thusly: char huge * p_huge p_huge = (char huge *)_halloc(size); (Please note that I haven't actually done this today, but I HAVE been through that section of the MS manuals multiple times, so I feel safe in saying this.) Good luck! Fred