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

Records: Verify value based equality #1046

Open
badcel opened this issue Apr 17, 2024 · 0 comments
Open

Records: Verify value based equality #1046

badcel opened this issue Apr 17, 2024 · 0 comments

Comments

@badcel
Copy link
Member

badcel commented Apr 17, 2024

Follow up to #1000.

In most cases records are implemented as pointers, thus they are represented as SafeHandles. The current implementation supports the IEquality<> interface based on the handle´ of the SafeHandle`: Meaning two instances are equal if they point to the same memory.

From a user perspective this can be helpful. Another use case is that it is sufficient that the values of two records are equal to consider them equal.

In the C world two pointers are equal if they point to the same memory location. This is valid for Records, too. In C it is easy to dereference a pointer to compare their actual values. This feature is missing in gir.core currently.

Verify if there is need for value based equality and how to implement it.

(This could require usage of blitable types in structs, see #1000.)

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

No branches or pull requests

1 participant