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

Implementation default GetHashCode for value types #800

Open
tgiphil opened this issue Sep 13, 2020 · 0 comments
Open

Implementation default GetHashCode for value types #800

tgiphil opened this issue Sep 13, 2020 · 0 comments

Comments

@tgiphil
Copy link
Member

tgiphil commented Sep 13, 2020

Here's the plan:

  • For value types without references fields or empty space between fields, return XOR all the bytes of the structure.
  • For all other value types, return the first non-reference field.

Implementation:

Emit the starting location and size of the value type data for the XOR computation within the runtime tables. Then the runtime would calculate the hash code given the information in the runtime tables.

@tgiphil tgiphil self-assigned this Sep 13, 2020
@tgiphil tgiphil changed the title Default GetHashCode Implementation Default GetHashCode Implementation for Value Types Sep 13, 2020
@tgiphil tgiphil added this to To do in Features [Archive] Sep 28, 2020
@tgiphil tgiphil added this to the 2.2 Release milestone Sep 9, 2021
@tgiphil tgiphil changed the title Default GetHashCode Implementation for Value Types Implementation default GetHashCode for value types Sep 9, 2021
@tgiphil tgiphil added this to To do in Code Generation Optimizations [Archive] via automation Sep 11, 2021
@tgiphil tgiphil modified the milestones: 2.2 Release, 2.4 Release Jan 12, 2023
@tgiphil tgiphil modified the milestones: 2.5 Release, 2.6 Release Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant