You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where MemoryObject is a 32 bytes object and Ptr are 8 bytes long. The size in C is 264 with the padding bytes. With cSizeOf it is 280.
I think the problem is that fields are not evaluated from left to right hence some offsets are wrong. From the documentation of Generics:
As :+: and :: are just binary operators, one might ask what happens if the datatype has more than two constructors, or a constructor with more than two fields. The answer is simple: the operators are used several times, to combine all the constructors and fields as needed. However, users /should not rely on a specific nesting strategy/ for :+: and :: being used. The compiler is free to choose any nesting it prefers. (In practice, the current implementation tries to produce a more or less balanced nesting, so that the traversal of the structure of the datatype from the root to a particular component can be performed in logarithmic rather than linear time.)
I will try to submit a patch
The text was updated successfully, but these errors were encountered:
I have a datatype with 32 fields and the offsets of some of the fields are wrong as is the global cSizeOf the structure.
My data structure:
where MemoryObject is a 32 bytes object and Ptr are 8 bytes long. The size in C is 264 with the padding bytes. With cSizeOf it is 280.
I think the problem is that fields are not evaluated from left to right hence some offsets are wrong. From the documentation of Generics:
I will try to submit a patch
The text was updated successfully, but these errors were encountered: