The changes in this PR have proven to be working: see GitHub CI Run (Note this run includes the PRs #93 and #94)
This PR makes two adjustments to the createClass method:
It fixes the discussed alignmentMask property passed to the Swift Runtime
It replaces let instanceSize = Int32(md.pointer.pointee.classSize) with let instanceSize = Int32(md.pointer.pointee.instanceSize)
To my knowledge and careful reading through the Class Metadata Layout docs to me, using .classSize here seems wrong. The value is not constant across platforms while instanceSize is. I'm not really an expert with the Swift Runtime, so feel free to correct me if I'm wrong.
Further, this PR reenables some tests cases which were previously skipped on linux platforms (which allowed for this issue being unnoticed).
My comment in https://github.com/wickwirew/Runtime/issues/49#issuecomment-872265231 explains the issue and how to resolve (to my understanding and knowledge) in detail.
The changes in this PR have proven to be working: see GitHub CI Run (Note this run includes the PRs #93 and #94)
This PR makes two adjustments to the
createClass
method:let instanceSize = Int32(md.pointer.pointee.classSize)
withlet instanceSize = Int32(md.pointer.pointee.instanceSize)
To my knowledge and careful reading through the Class Metadata Layout docs to me, using.classSize
here seems wrong. The value is not constant across platforms whileinstanceSize
is. I'm not really an expert with the Swift Runtime, so feel free to correct me if I'm wrong.Further, this PR reenables some tests cases which were previously skipped on linux platforms (which allowed for this issue being unnoticed).