view runtime/rhopefuncs_epilog.c @ 186:ba35ab624ec2

Add support for raw C function output from C backend as well as an option to use Boehm-GC instead of reference counting
author Mike Pavone <pavone@retrodev.com>
date Fri, 07 Oct 2011 00:10:02 -0700
parents bac2c74801f0
children
line wrap: on
line source

#ifdef RAW_FUNC
DispatchVar
#else
DO_END:
	for(idx = 0; idx < cdata->num_params; ++idx)	
		params[idx] = cdata->params[idx];
	free_context(ct);
	return cdata->num_params;

DO_END_THREAD:
	for(idx = 0; idx < cdata->num_params; ++idx)
	{ release_ref(cdata->params[idx]); }
	if(ct->runafter)
	{
		temp_ct = ct;
		ct = ct->runafter;
		free_context(temp_ct);
		cdata = ct->resume_cdata;
		func = cdata->func;
		DISPATCH
	}
	free_context(ct);
	if(ct = get_cqueue())
	{
		cdata = ct->resume_cdata;
		func = cdata->func;
		DISPATCH
	}
NOTHING_TO_DO:
	return 0;

_exception:
	puts("Exception! Trace follows:");
	while(cdata && cdata->func < END)
	{
		printf("%d\n", cdata->func);
		cdata = cdata->lastframe;
	}
	return -1;
}
#endif //RAW_FUNC