(Partially) make the long-lived allocator optional #8101
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's still more code in
gc_alloc
that could be simplified, but this will wait until after the micropython merges because there's also upstream churn.I tested this on the unix port (only) with LL both enabled and disabled. The mpconfig.mk has to be edited to change the setting, so CI will only test one way.
It's not quite fair to say this "closes" #2687 but it does allow someone who is affected by the difference in identity semantics to turn it off in a custom build.
In practice we may want to consider turning the feature off in our less claustrophobic builds, particularly those with megs of PSRAM. For now, it's left turned on in all builds, because we'd want to measure the impacts before making a decision.
It also frees up about 1kB of code space in trinket_m0 when
CIRCUITPY_LONG_LIVED_GC=0
though that's one of those "claustrophobic RAM" boards where long-lived helps the most :-/