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
Fix issue 10023 - Add rtInfo (or equivalent) to ModuleInfo. #2271
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,7 @@ void Module::genmoduleinfo() | |
#define MIunitTest 0x200 | ||
#define MIimportedModules 0x400 | ||
#define MIlocalClasses 0x800 | ||
#define MIrmInfo 0x1000 | ||
#define MInew 0x80000000 // it's the "new" layout | ||
|
||
unsigned flags = MInew; | ||
|
@@ -124,6 +125,8 @@ void Module::genmoduleinfo() | |
flags |= MIimportedModules; | ||
if (aclasses.dim) | ||
flags |= MIlocalClasses; | ||
if (rmInfo) | ||
flags |= MIrmInfo; | ||
|
||
if (!needmoduleinfo) | ||
flags |= MIstandalone; | ||
|
@@ -172,6 +175,10 @@ void Module::genmoduleinfo() | |
dtxoff(&dt, cd->toSymbol(), 0, TYnptr); | ||
} | ||
} | ||
if (flags & MIrmInfo) | ||
{ | ||
rmInfo->toDt(&dt); | ||
} | ||
|
||
// Put out module name as a 0-terminated string, to save bytes | ||
nameoffset = dt_size(dt); | ||
|
@@ -196,6 +203,7 @@ void Module::genmoduleinfo() | |
void *sharedctor; | ||
void *shareddtor; | ||
uint index; | ||
void *rmInfo; | ||
void*[1] reserved; | ||
} | ||
*/ | ||
|
@@ -293,6 +301,11 @@ void Module::genmoduleinfo() | |
|
||
dtdword(&dt, 0); // index | ||
|
||
if (rmInfo) | ||
rmInfo->toDt(&dt); | ||
else | ||
dtdword(&dt, 0); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it about time that the 'old' layout be dropped perhaps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's already been merged. I'll remove that when I update to latest master. |
||
// void*[1] reserved; | ||
dtdword(&dt, 0); | ||
#endif | ||
|
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.
Why keep around
void*[1] reserved
if you're adding a new field that takes up that space?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.
No reason. I'll remove it.
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.
Just a note that the reserved field brings the size of ModuleInfo is 64 bytes (128 on 64bit) - there's probably am reason why it was padded up to a power of 2. Though can't think why at this moment. :)