lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks for the fast reply,

> >2)I was hoping that there would be some way to get rid of the wrappers
> >for ech C function you wan't to call from lua code.Would it be
> >possible to write a universal wrapper that get's called in every
> >function call,then gets the function address and args (somehow... like
> >from the stack) and calls the C function(via inline assembly).
> 
> Not portably, but yes. I think libffi (I forget the name) does this.

the portability issues have to do with the calling convention I
assume.That would be no problem since it would only take minor
alterations in the universal wrapper to port it.How is it possible to
make the lua interpreter call the wrapper function instead of the
actual C function supplying it with C function pointer and args(so
that the wrapper can do the actual calling)?