Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

add _d_assertp, _d_unittestp, _d_arrayboundsp#1761

Merged
WalterBright merged 1 commit intodlang:masterfrom
WalterBright:assertp
Feb 10, 2017
Merged

add _d_assertp, _d_unittestp, _d_arrayboundsp#1761
WalterBright merged 1 commit intodlang:masterfrom
WalterBright:assertp

Conversation

@WalterBright
Copy link
Member

The "m" functions are no longer used. The "p" versions use fewer bytes of code to call. The efficiency loss with the strlen is irrelevant.

/* One of these three is called upon an assert() fail.
*/
void _d_assertm(immutable(ModuleInfo)* m, uint line)
void _d_assertp(immutable(char)* file, uint line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can file be passed as a D string directly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the idea is to reduce the amount of machine code needed at the call site.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a D string would require this? I mean, I have no idea about these things.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There would be an extra register push (on x86_64, or depending on whatever other target ABI a stack store) to set up the length argument.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right.

@WalterBright
Copy link
Member Author

Blocking dlang/dmd#6530

@dnadlinger
Copy link
Contributor

Auto-merge toggled on

@dnadlinger
Copy link
Contributor

DAutoTest is still failing…

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants