Microsoft C - Heap space question

Paul Gyugyi gyugyi at portia.Stanford.EDU
Fri Sep 8 06:12:12 AEST 1989


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



More information about the Comp.lang.c mailing list