Xref: utzoo comp.sys.ibm.pc:34328 comp.lang.c:21567 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!shelby!portia!gyugyi From: gyugyi@portia.Stanford.EDU (Paul Gyugyi) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Microsoft C - Heap space question Keywords: heap microsoft-c Message-ID: <5172@portia.Stanford.EDU> Date: 7 Sep 89 20:12:12 GMT References: <3631@cbnewsh.ATT.COM> <4143@csd4.csd.uwm.edu> <2930@puff.cs.wisc.edu> Sender: Paul Gyugyi Reply-To: gyugyi@Portia.Stanford.EDU (Paul Gyugyi) Followup-To: comp.sys.ibm.pc Distribution: usa Organization: Stanford University Lines: 10 Another way to get stack and heap ("near data") to be seperate is the compiler option /Gt. Specifying /Gt will place every variable in the near heap (i.e. things you didn't specify as "far") bigger than some threshold (default 256bytes) into it's own segment. When compiling the new version of NetHack, I had to use /Gt:1 to put all data into seperate segments because there was more than 64K of chars and ints. MSC is smart enough to recombine the million segments this generates into several larger ones, so efficiency isn't greatly compromise, and everything works fine without changing the code. -gyug