lua-users home
lua-l archive

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

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.

I personally don't see anything bad in using such hacks except the direct consiquences of architecture/platform dependance.

----- Original Message ----- From: Peter Cawley
To: Lua list
Sent: Sunday, October 18, 2009 3:19 AM
Subject: Re: Conversion Lua function to C function

If you're thinking what I think you are, then it would be an operating
system dependant, and processor architecture (or at least CPU
bytecode) dependant. Note that some 32 versions of Windows (around
NT4?) could run on non-x86 architectures. Linux can do the same.

2009/10/17 GrayFace <>:
The only way see is to use a platform-dependant hack. For 32 bit Windows I can tell you how to do it. It should be easy to tweak it to use it on 32 bit Linux.