[SOLVED]garbage collect destroying memory despite pointer chain from a root pointer.

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
jickster
Posts: 628
Joined: Thu Sep 07, 2017 8:57 pm

[SOLVED]garbage collect destroying memory despite pointer chain from a root pointer.

Post by jickster » Mon Apr 16, 2018 7:08 pm

(title could be better).

This problem was solved by dhylands but making a separate post for someone to find the solution easier.

PROBLEM:
Garbage collect destroying memory that has a valid chain of pointers starting with a root pointer.



SOLUTION:
dhylands wrote:
Mon Apr 16, 2018 4:11 pm
One possible "chain" that I don't believe that the gc follows is if you have a heap object pointing back into non-heap (i.e. static globals) and those static globals have a pointer into the heap. In that case, the gc wouldn't see the pointer from the static data. The gc only follows pointers within the heap itself.

Since you're building things dynamically, and your module object is declared statically, this might be the cause.

Post Reply