-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
implement sizeof and alignof operator #5664
Closed
+906
−236
Closed
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
7ceb7ab
basic refactor
krux02 ccbd9e8
renamed computeSizeAux→computeSizeAndAlign
krux02 9ccfeb3
fix bug in times.nim
krux02 892bc99
format code
krux02 037c9c0
more refactoring
krux02 f3476a1
some work in progress
krux02 2f560f0
code reduction
krux02 e0334ab
WIP
krux02 cb14a8c
WIP
krux02 181a06d
add todo
krux02 376f22a
make bug visible
krux02 a0b17bc
a big step for me a small step for humanity
krux02 72d5d0d
my test now passes
krux02 aad3c89
removed debug information
krux02 db15fcc
removed old tsizeof.nim
krux02 a9eff03
move tsizeof into tests folder
krux02 7092c97
move size align offset into its own file
krux02 d6041b0
tsizeof now almost works for packed types
krux02 3dadd53
some renaming
krux02 802dc5d
fixes for breaking change of do notation
krux02 63a3a8f
WIP with debug output, and amend to trigger tests
krux02 e0e8e37
added bug
krux02 7a9419b
hard to find bug fixed, but still bugged
krux02 3e1800b
Merge branch 'devel' into sizeof-alignof
krux02 e7cf79d
post merge fix 1
krux02 8280f04
minimal fixes
krux02 9582a45
Merge branch 'devel' into sizeof-alignof
krux02 cbe99e1
fix for enum alignment
krux02 b302fd3
instance test size packed and unpacked
krux02 9b2aa8d
remove dead code, and make compilation fail at WIP
krux02 04c0a55
Merge branch 'devel' into sizeof-alignof
krux02 5f81489
update sizeof test, put back sizeof fallback
krux02 bf7db99
this should make tests on osx green
krux02 2cda6c4
Delete rodread.nim
krux02 1cd7a84
Delete rodwrite.nim
krux02 cda1ab4
better sizeof for imported types
krux02 209e8c0
remove debug output
krux02 2afcc69
let casting of imported types be a problem of the backend
krux02 c746166
detect illegal recursion in partially imported types
krux02 f7ad91b
sizeof unchecked array ;)
krux02 7a56147
Merge branch 'devel' into sizeof-alignof
krux02 b0b1b36
recursive tuples are detected again
krux02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2612,4 +2612,3 @@ tests: | |
|
||
yes int, ordinal | ||
no string, ordinal | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will that work with incomplete types that have at least 1 field?
see also #9250 for a more robust solution (that can be implemented after your PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally I was looking at the wrong location for the importc flag. Now it should work properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krux02 is my assessment in #9250 correct that currently you must pessimistically reject computing sizeof for any type annotated as
importc
? feel free to comment in #9250There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct.