Replies: 1 comment 2 replies
-
I don't have the knowledge to answer this, transferred from |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'll be the first to acknowledge that my issues are very peculiar, and that this is about a very exotic platform. I'm asking the question in hope that I can get some help.
I'm compiling and running Python on iOS. Cross-compiling Python modules using maturin is now a breaze, thanks to all the hard work here. I can now include modules like
rpds
andcryptography
in my Python builds.I'm am currently stuck on the next step: I need to be able to quit the Python interpreter, and restart it at a later time. That requires cleaning up the memory, freeing up everything that was allocated, and (at a later date) reallocating it (I do acknowledge that is a very specific issue).
In my current state of affairs, with modules created with maturin (
rpds
, namely, but it uses just:#[pymodule(gil_used = false)]
), deallocation works fine (themd_dict
pointer is set to NULL, same withmd_name
), but the pointer to the module itself is not set to NULL. When I run the initialization a second time, it returns the same pointer to the module, but it does not recreate themd_dict
dictionary and other members. As a consequence, Python crashes when trying to access a NULL pointer.Is there any way I could fix this, either without changing
pyo3
andmaturin
, or with minimal changes topyo3
andmaturin
?Beta Was this translation helpful? Give feedback.
All reactions