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

Ensure that all empty PersistentLists are the same instance. #91

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

popematt
Copy link
Contributor

Issue #, if available:

None

Description of changes:

There's a problem in kotlinx.collections.immutable (described in Kotlin/kotlinx.collections.immutable#176) that was causing ion-element-kotlin to unnecessarily allocate large numbers of empty lists for unannotated values (and anywhere else that had a possibly-empty list).

Unfortunately, we won't be able to use the fix from that PR until we can update ion-element-kotlin to Kotlin >= 1.9.
This adds our own extension functions to work around the bug.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 88.37209% with 5 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (master@5b9ec91). Click here to learn what that means.

Files Patch % Lines
src/com/amazon/ionelement/api/Ion.kt 81.48% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #91   +/-   ##
=========================================
  Coverage          ?   90.01%           
  Complexity        ?      496           
=========================================
  Files             ?       31           
  Lines             ?     1062           
  Branches          ?      157           
=========================================
  Hits              ?      956           
  Misses            ?       63           
  Partials          ?       43           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jobarr-amzn jobarr-amzn left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for finding and fixing this!

@popematt popematt merged commit df159ac into amazon-ion:master Mar 14, 2024
5 checks passed
@popematt popematt deleted the memory_fix branch March 14, 2024 00:08
@popematt popematt mentioned this pull request Sep 19, 2024
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.

3 participants