Restore automatic gc_collect() after an import by dhalbert · Pull Request #6406 · adafruit/circuitpython · GitHub
Skip to content

Restore automatic gc_collect() after an import#6406

Merged
tannewt merged 1 commit into
adafruit:7.3.xfrom
dhalbert:restore-gc-collect-on-import
May 18, 2022
Merged

Restore automatic gc_collect() after an import#6406
tannewt merged 1 commit into
adafruit:7.3.xfrom
dhalbert:restore-gc-collect-on-import

Conversation

@dhalbert

Copy link
Copy Markdown
Collaborator
  • Fixes MemoryError MatrixPortal #6402.

  • The automatic garbage collection done after an import got lost in the MicroPython v1.18 merge, which rewrote the import code extensively. Restore it. This reduces heap fragmentation, which can make prevent allocating big buffers after significant imports.

  • Improved error message for RGBMatrix being unable to allocate buffers. Previously, it just threw a blank MemoryError.

@dhalbert dhalbert requested a review from tannewt May 18, 2022 15:42

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One request. Thanks for finding this!

Comment thread shared-module/rgbmatrix/RGBMatrix.c
@dhalbert dhalbert requested a review from tannewt May 18, 2022 16:11
@tannewt tannewt merged commit 4637855 into adafruit:7.3.x May 18, 2022
@dhalbert dhalbert deleted the restore-gc-collect-on-import branch May 18, 2022 19:10
@dhalbert dhalbert restored the restore-gc-collect-on-import branch May 18, 2022 22:55
@dhalbert dhalbert deleted the restore-gc-collect-on-import branch May 18, 2022 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants