gir.core icon indicating copy to clipboard operation
gir.core copied to clipboard

Records: Verify value based equality

Open badcel opened this issue 1 year ago • 0 comments

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.)

badcel avatar Apr 17 '24 19:04 badcel