Skip to content

Do not key WeakHashMap by Integer - #60223

Open
Yqwed wants to merge 1 commit into
react:mainfrom
Yqwed:weakhashmap-identity
Open

Yqwed wants to merge 1 commit into
react:mainfrom
Yqwed:weakhashmap-identity

Conversation

@Yqwed

@Yqwed Yqwed commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

After JEP-401 that will throw IdentityException. Also, int-s outside of [-128;128) are not cached and boxing creates new instances, meaning that GC is free to reclaim them immediately.

getStyleFromString only returns 7 different values and the map stores pair of int-s: using LruCache-s is overkill and CHM is fine.

#60220

Summary:

Do not key WeakHashMap by Integer as preparation for JEP-401

Changelog:

Do not key WeakHashMap by Integer as preparation for JEP-401.

Pick one each for the category and type tags:

[ANDROID][FIXED] -
Do not key WeakHashMap by Integer

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Test Plan:

After JEP-401 that will throw IdentityException. Also, int-s
outside of [-128;128) are not cached and boxing creates new
instances, meaning that GC is free to reclaim them immediately.

getStyleFromString only returns 7 different values and the map
stores pair of int-s: using LruCache-s is overkill and CHM
is fine.

react#60220
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 22, 2026
@Yqwed

Yqwed commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@javache this is similar to #56196

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 22, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at e94f3944848b.

ios: no capture

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant