Neal Becker
2016-04-06 13:18:24 UTC
I have C++ code that tries to share the mtrand state. It unfortunately
depends on the layout of RandomState which used to be:
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
rk_state *internal_state;
PyObject *lock;
};
But with 1.11 it's:
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
struct __pyx_vtabstruct_6mtrand_RandomState *__pyx_vtab;
rk_state *internal_state;
PyObject *lock;
PyObject *state_address;
};
So
1. Why the change?
2. How can I write portable code?
depends on the layout of RandomState which used to be:
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
rk_state *internal_state;
PyObject *lock;
};
But with 1.11 it's:
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
struct __pyx_vtabstruct_6mtrand_RandomState *__pyx_vtab;
rk_state *internal_state;
PyObject *lock;
PyObject *state_address;
};
So
1. Why the change?
2. How can I write portable code?