Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore automatic gc_collect() after an import #6406

Merged
merged 1 commit into from
May 18, 2022

Conversation

dhalbert
Copy link
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
Copy link
Member

@tannewt tannewt left a comment

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!

shared-module/rgbmatrix/RGBMatrix.c Show resolved Hide resolved
@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