Hi Andy, Andy Wingo writes: > On Mon 25 Feb 2013 01:34, Mark H Weaver writes: > >> The current limitation of 10 arguments to foreign functions is proving >> to be a problem for some libraries, in particular the Allegro game >> library. >> >> Is there a reason why raising this limit to 16 or 20 would be >> undesirable? What tradeoffs are involved? > > Each arity of foreign functions gets a little VM program stub that > checks the argument count then actually does the call. We statically > generate the first N of those arities (currently 10), and then for the > rest we should dynamically allocate the objcode stubs. Dynamic > allocation is currently unimplemented. I've attached a patch that implements dynamic allocation of objcode stubs for larger arities. What do you think? Thanks, Mark