I have a C function that expects an opaque void* pointer to hold some user data. This is specifically about a small problem with Sundials.jl, but it's also unclear to me generally.
How do I safely pass a Julia value to the function? What are the conventions? The value will later be passed to Julia callbacks, so it needs to remain valid forever. I don't mind leaking it, if necessary. The function CVodeUserData in Sundials.jl expects either (Ptr{None}, Ptr{None}) or (Ptr{None}, Any) (the 2nd argument is the Julia value, the first is library's internal structure). Which of these is correct? The original code for CVodeUserDataB seems to use Ptr{None} (why not Ptr{Void} or Any?), but I keep getting an error saying that my Julia has no method matching convert(::Type{Ptr{Union()}}, ::MyType). Is Any the correct type for a Julia value to be passed to C? Will the value be moved or deallocated?