Re: lua_CFunctions taking a cdata

  • From: Mike Pall <mike-1207@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 11 Jul 2012 17:39:21 +0200

Daurnimator wrote:
> I've got a luajit being controlled by another; and I'd like to
> marshall CDATA objects across.

This won't work.

First, you'll need all of the type declarations in both VMs,
anyway. But then you can easily pass that object via the C side.

> I essentially need a pointer to it, and the type...

Pass a lightuserdata and cast it to a struct pointer in the other
VM (once!). Then you can simply share all of the data on the C
side between both VMs.


Other related posts: