-
Notifications
You must be signed in to change notification settings - Fork 1.3k
A few heap related tweaks #985
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
Conversation
tannewt
commented
Jul 3, 2018
- Long live byte strings
- Long live code.py code
- Collect after import
- Limit max QSTR pool size
This prevents bugs where gc_collect is called from C code that did a recent allocation.
Imports generate a lot of garbage so cleaning it up immediately reduces the likelihood longer lived data structures don't end up in the middle of the heap. Fixes micropython#856
Travis is testing nrf fix. In the meantime I forgot to post the videos: before: https://www.youtube.com/watch?v=dabIOpBfnks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!! Should make larger programs more feasible in many cases.
ports/nrf/Makefile
Outdated
@@ -213,7 +213,7 @@ FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') | |||
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) | |||
|
|||
OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) | |||
OBJ += $(BUILD)/pins_gen.o | |||
OBJ += $(BUILD)/pins_gen.o supervisor/cpu.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a SRC_S variable and then using addprefix to change to .o would probably be cleaner :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks for the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to do SRC_S
in atmel-samd/Makefile
too?
ports/atmel-samd/Makefile
Outdated
@@ -412,13 +412,16 @@ endif | |||
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ | |||
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) | |||
|
|||
SRC_O = supervisor/$(CHIP_FAMILY)_cpu.o | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here that you did in the nrf makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Please take another look.
@dhalbert Please take a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, somehow I missed your changes from 3 days ago! Looks great!