[Microbit-Python] How does GC work in micro:bit MicroPython?

Damien George damien.p.george at gmail.com
Mon Oct 12 11:16:06 CEST 2015


For now I would not do anything about it, especially if it's not a
show stopper at this point.

I would follow these principles:

- make it easy to change the allocation/realloc/free functions

- make as much stuff dynamically allocated as possible (ie put as
little in the bss/data area as possible, ie as few global variables as
possible); this is because some people might not use your
classes/features and you don't want to take away their precious RAM
for unused features



On Mon, Oct 12, 2015 at 10:11 AM, Larry Hastings <larry at hastings.org> wrote:
> On 10/12/2015 02:06 AM, Damien George wrote:
>
> I didn't turn on finalisers because from experience they are rarely
> needed.  But they are not expensive to turn on so we can if needed.
>
> __del__ goes in the dict_table.
>
> I think we should fix this properly instead of monkey patching here
> and there.  Properly means combining the 2 heaps (uPy GC and C++).
> This would also give more RAM overall because then there's not a hard,
> fixed barrier between the 2 heaps which is currently 9.5k and 2k.
>
>
> When you say "we should fix this properly", I suspect you mostly mean you.
> I don't know if I can be of much help.
>
> What should I do for now?  Just not worry about it?  I expect few people
> will create more than one scheduler, one button minder, and at most three
> accelerometer scalers, and these objects will live for the duration of the
> program.
>
>
> /arry
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list