[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Conversion Lua function to C function
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Sun, 18 Oct 2009 01:38:40 -0700
On Sunday 18, GrayFace wrote:
> I'm thinking of the same way window procedures are done in Delphi. Allocate
> memory blocks for executtion (VirtualAlloc on Windows, dunno what on Linux.
> Maybe even malloc would be fine), write delegates there: write machine code
> for call instruction + the parameter to function.
> I wasn't correct about 32-bit Windows. I mean 32-bit applications for
> Windows. No matter what the real processor is as long as it supports 32-bit
> applications. For other architectures it would need different call opcode,
> for other systems it would need different memory allocation.
> I hoped such thing was in some kind of cross-platform library, but brief
> googling hasn't given the needed result. Maybe someone else would be more
> lucky.
You could do this with a JIT like LLVM [1] or libjit [2]
[1] http://llvm.org/
[2] http://libjit.com/
--
Robert G. Jakabosky