How does non-GC mode work? What are the pros & cons?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
igorgatis
Posts: 21
Joined: Thu Nov 19, 2015 1:10 pm

How does non-GC mode work? What are the pros & cons?

Post by igorgatis » Thu Nov 19, 2015 1:47 pm

I went through the code but I could not quite understand how non-GC mode (MICROPY_ENABLE_GC = 0) works.

What are the main advantages of enabling/disabling GC?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: How does non-GC mode work? What are the pros & cons?

Post by pfalcon » Thu Nov 19, 2015 2:07 pm

"non-GC" mode works the way classical PHP did: it allocates memory, never frees. How useful is that, you can judge for yourself (people used old PHP and found it useful). For all practical purposes, ability to disable GC is debugging measure. (Or you can disable it, native uPy GC, and integrate another GC).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply