bug in limit checks and threads

Stephen Weeks sweeks@intertrust.com
Wed, 4 Oct 2000 18:40:21 -0700 (PDT)


> re the new LimitCheck() macro, please indent things more K&R style: the inner
> do body (every thing from the `uint bytes = b' to the `frameSize, ret);' has
> to be indented one more tab stop.  (Also, there should be a tab between the
> `uint' and the `bytes' on the first line of this body.)

OK.  Hows this?

#define LimitCheck(frameSize, ret, b, other)					\
	do {									\
		declareFirst;							\
										\
		if (INSTRUMENT)							\
			MLton_numLimitChecks++;					\
		if (GC_EVERY_CHECK						\
		or (GC_FIRST_CHECK and gc_first)				\
		or frontier + (b) > gcState.limit				\
		or (other)) {							\
			do {							\
				uint	bytes = b;				\
										\
				InvokeRuntime					\
					(GC_gc(&gcState, bytes,			\
						GC_EVERY_CHECK or		\
						(GC_FIRST_CHECK and gc_first),	\
						__FILE__, __LINE__),		\
					frameSize, ret);			\
			} while (frontier + (b) > gcState.limit);		\
			clearFirst;						\
		}								\
		assert(gcState.stackBottom <= stackTop + WORD_SIZE);		\
	} while (0)