[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: LuaJIT calling embedded code.
- From: Tim Caswell <tim@...>
- Date: Tue, 27 Sep 2011 15:43:34 -0700
As some of you may have heard, I'm having great fun porting nodeJS to luajit. <https://github.com/creationix/luvit>
While working on the C bindings for libuv, I was told by a coworker who has used luajit that I should be using the ffi module instead of writing manual C bindings.
His reasoning (and repeated by Mike in the FFI docs) is that the jit can better optimize ffi calls than raw C bound calls since it know what they will be doing.
My problem is I'm binding to a library that's part of my binary. It's not ever compiled as a shared object that I can dlopen. Is it possible to use the ffi module to open symbols on my own running binary?
If this is possible, and it would indeed be faster, how would I go about trying this?