I'm trying to share pointers into lua (not for lua to use) but to pass back into the program when required, can I just return the pointer as a integer and then return it back to the program as a integer? the only problem I can see is if I compile as 64bit, the pointer becomes the size of a long which would overflow the integers, meaning only 32bit would match lua and work. am I right in thinking this or does someone have tutorial on implementing c++ objects into lua to be used without constant function calls to get the variables of a pointer on the c++ side.
Edit: the question wasn't really specific, does anyone have a methodology of exposing C++ objects to Lua?