Richard W.M. Jones wrote:
We also suffer this problem in reverse: passing a pointer between
C libraries is not possible in another non-C language. eg. Passing a
libvirt virDomainPtr from (Perl) Sys::Virt to Sys::Guestfs.
Well, if the language supports sufficiently large integers and runs in
process, you can abuse an integer as the handle.
"Sufficiently large" generally means sizeof(void*) bytes, i.e.
sizeof(void*)<<3 bits, but you can get creative and get away with
(sizeof(void*)<<3)-k-bit integers if your pointers are guaranteed to be
aligned to 1<<k bits.