We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently we use GenericLayout to calculate offsets of PyObject members (like this).
Instead we could do the usual offset/size dance:
offset/size
extension PyObject { public static let member2Offset = calculateOffset( previousMemberOffset: Self.member1Offset, previousMemberSize: MemoryLayout<Member1Type>.size, alignment: MemoryLayout<Member2Type>.alignment ) } func calculateOffset(previousMemberOffset: Int, previousMemberSize: Int, alignment: Int) -> Int { var offset = previousMemberOffset + previousMemberSize return round(offset, to: alignment) }
Though, I have not checked what Swift compiler emits for the current version, so maybe it is not needed.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently we use GenericLayout to calculate offsets of PyObject members (like this).
Instead we could do the usual
offset/size
dance:Though, I have not checked what Swift compiler emits for the current version, so maybe it is not needed.
The text was updated successfully, but these errors were encountered: