Skip to content
Discussion options

You must be logged in to vote

It seems like I can set objects as MICROPY_PORT_ROOT_POINTERS in the micropython port config file, but I can only see examples of that where the number of objects is known at compile time. I need to be able to create and remove any number of these object, without fear that they will be removed by the GC, and am happy to handle removing that memory in the C level.

MICROPY_PORT_ROOT_POINTERS has been removed in favour of MP_REGISTER_ROOT_POINTER. It's much simpler because you no longer need to have mpconfigport.h know about your root pointers.

See for example https://github.com/micropython/micropython/blob/master/ports/stm32/pin.c#L679

In your case where you have a list of objects, you s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by birdistheword96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants