Using ccall for C function with out-parameter pointer to pointer to struct

I think you’ll want unsafe_load(state[]).