[Gc] Changes requested to reduce GC heap growth on Windows

Lee teelf at ascendantmud.net
Tue Jan 27 10:33:13 PST 2004

Derek wrote:
> Attached is a small diff of required changes for gc compiled with the
> MSFT family of C compilers.  Please review this request and check for
> correctness.  I have tested this on WinXP/2K/2KAdvanced/win98 and it
> appears to be satisfactory.
> The issue is with statements like:
> 	while ( 0 == h && GET_MEM()) {
> 		h = GC_allochblk(...);
> 	}
> The microsoft compilers do not optimize the execution by not calling
> the right side of the && expression if the left side is true (vc98 and
> vc7).  This leads to double heap growth which is not desirable.
> thanks

The compiler has to evaluate the right side if the left side is true.  If
you meant to say when the left side is false, I have never ran into that
problem using vc98 or vc7.  Many a null pointer would be dereferenced if not
for lazy evaluation.

More information about the Gc mailing list