Optionally store StaticPyObjStore on micropython heap via root pointer#20
Optionally store StaticPyObjStore on micropython heap via root pointer#20swuerl wants to merge 3 commits intostinos:masterfrom
Conversation
|
Can you maybe help me out here? https://ci.appveyor.com/project/stinos/micropython-wrap/builds/51082056/job/tjk2dtc0su3ch6pr It seems the root pointer is not correctly registered for the windows build. In the code, this happens in Is |
Indeed it is not, it is used only for those builds which use a user C module. So that's essentially never for the msvc builds, and only for 1 from the 3 build types in the Makefile |
|
Ah, understood. In this case that means micropython needs to be aware of the root-pointer for micropython-wrap, even if the modules themselfes are dynamically linked in later. For the unix/msys2 builds this should be possible by injecting it via the Do you know if there is something similar possible for the msvc build? |
Related to #16
This optionally moves the
StaticPyObjStorefrom being attached to a random module to a new global storage for micropython-wrap that uses a micropython root pointer. The root pointers are saved from garbage collection in micropythons internal implementation. As such the implementations should be equal.In the process a
MPyMapViewclass was added, which allows for C++-style access to micropython maps.IMHO this should be default behaviour in the future: this makes the
_StaticPyObjStorevariable, which is an implementation detail of micropython-wrap, invisible to the user. I did not enable it by default here, as it breaks the interface by requiring explicit definition of the root pointer by the user. Once we have some confidence with this implementation, we could maybe add a deprecation#warningin case it is not enabled? But maybe you also just want to keep the old behaviour.