From: Cefn Hoile Date: Tue, 20 Feb 2018 17:09:51 +0000 (+0000) Subject: Reversed mistakenly committed tweak. Introduced conservative garbage collection to... X-Git-Tag: 0.1.0~4^2~60 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/ebd564d6aea7704a2fd6e2635f49cf7a6795d85d?ds=inline Reversed mistakenly committed tweak. Introduced conservative garbage collection to minimise heap fragmentation --- diff --git a/python/agnostic.py b/python/agnostic.py index 167b4d6..154360a 100644 --- a/python/agnostic.py +++ b/python/agnostic.py @@ -4,7 +4,9 @@ environment is established, can choose various routes to make available and re-export common modules and operations, depending on platform support """ +import gc import sys +gc.collect() try: microcontroller = sys.platform @@ -24,6 +26,7 @@ else: implementation = sys.implementation.name if implementation == "micropython": - from utime import sleep, time + from utime import sleep elif implementation == "circuitpython": - from time import sleep, time + from time import sleep +gc.collect()