diff runtime/main_end.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
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/main_end.c	Fri Oct 07 00:10:02 2011 -0700
@@ -0,0 +1,26 @@
+	
+#ifdef ENABLE_PROFILING
+	for (idx = 0; idx < END; ++idx)
+	{
+		if(profile_counts[idx])
+			printf("Func: %d\tCount: %llu\tTime: %llu\tAvg: %f\tSelf: %llu\tAvg: %f\tNested Count: %llu\n", idx, profile_counts[idx], profile_totals[idx], ((double)profile_totals[idx])/((double)profile_counts[idx]), profile_selftotals[idx], ((double)profile_selftotals[idx])/((double)profile_counts[idx]), profile_nestedcounts[idx]);
+	}
+#endif
+	if (!numret)
+		return 0;
+	if (numret < 0)
+		return numret;
+	if (get_blueprint(inout[0])->type_id == TYPE_INT32)
+		return ((t_Int32 *)inout[0])->Num;
+
+#ifdef RAW_FUNC
+	ret = f_If(1, inout);
+	if (ret.retvals[0])
+#else
+	rhope(FUNC_If, inout, 1, 2);
+	if (inout[0])
+#endif
+		return 0;
+	return 1;
+}
+