Can lua_State be stored in shared memory?

I guess not (or if possible, almost certainly not worth my time).

What I think is to construct a mirror containing object offset_ptr

that is also in the class that it belongs to lua_State

, which child processes can use to get the locations of the corresponding pointers in the state, whether or not that is possible .. there are other objects the methods lua_

could access, I'm not sure how to pass them the correct addresses ...

Guess I need a custom allocator too, not sure if this is supported?

+3


source to share


1 answer


Since Lua is implemented exclusively in standard C, lua_State

shared memory allocation is clearly not supported out of the box. You can look at changing the source to implement this feature manually, but it probably wouldn't be worth the trouble. Instead, you should leave lua_State

out of shared memory and just copy any important data into shared memory if needed.



+2


source







All Articles