Re: A way to associate a Lua value with a FFI pointer?

  • From: Richard Hundt <richardhundt@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 09 Apr 2014 11:26:58 +0200

On 4/9/14 11:20 AM, Daniel Kolesa wrote:
> Right, but p1's address stays the same - what I meant is you could do
> reg[ptr] = val and return reg[ptr] directly.

Sure, as long as you can be sure that you're passing around the *same*
pointer value, where *same* is not what in C you'd think of as the same.
Otherwise it'll bite. But as I said, I don't know your full use case.


Other related posts: