/*- Author: Brian Tiffin Dedicated to the public domain Date: September 2016 Modified: 2016-12-14/00:11-0500 Tectonics: gcc -o tightloop-cfunc.so -shared -fpic tightloop-cfunc.c +*/ /* sum of values from 0 to integer in argv[1] */ #include "../icall.h" int tightloop(int argc, descriptor argv[]) { int i; unsigned long total; ArgInteger(1); total = 0; for (i = 0; i <= IntegerVal(argv[1]); i++) total += i; RetInteger(total); }