Skip to content

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jul 3, 2018

  • Long live byte strings
  • Long live code.py code
  • Collect after import
  • Limit max QSTR pool size

tannewt added 8 commits July 3, 2018 05:45
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
@tannewt
Copy link
Member Author

tannewt commented Jul 3, 2018

Travis is testing nrf fix.

In the meantime I forgot to post the videos:

before: https://www.youtube.com/watch?v=dabIOpBfnks
after: https://www.youtube.com/watch?v=Q_hXDPc1L8Q

dhalbert
dhalbert previously approved these changes Jul 3, 2018
Copy link
Collaborator

@dhalbert dhalbert left a 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.

@@ -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
Copy link
Collaborator

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 :)

Copy link
Member Author

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

Copy link
Collaborator

@dhalbert dhalbert left a 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?

@@ -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

Copy link
Collaborator

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?

Copy link
Member Author

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.

@tannewt
Copy link
Member Author

tannewt commented Jul 9, 2018

@dhalbert Please take a look!

Copy link
Collaborator

@dhalbert dhalbert left a 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!

@dhalbert dhalbert merged commit 64b9ee9 into adafruit:master Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants