Skip to content
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

Issue 14992 - static array local variables always require .init #5014

Merged
merged 2 commits into from Feb 7, 2016

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Sep 1, 2015

https://issues.dlang.org/show_bug.cgi?id=14992

Add one more special case for static array of struct initialization with zero, similar to the special case for struct initialization.

@CyberShadow
Copy link
Member

Thanks, would you say that this makes dlang/druntime#1372 unnecessary or are there cases in which it will still be needed?

@9rnsr
Copy link
Contributor Author

9rnsr commented Sep 1, 2015

Currently, typeinfo object for struct should be generated on demand. So, such the interface modules for C library bindings do not have to be compiled and included in druntime.

* memset(&sarray, 0, struct.sizeof)
*/
elem *ey = NULL;
unsigned sz = ae->e1->type->size();
Copy link
Member

Choose a reason for hiding this comment

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

Should be targ_size_t, not unsigned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
14992 static array local variables always require .init

Add one more special case for static array of struct initialization with zero, similar to the special case for struct initialization.
@ibuclaw
Copy link
Member

ibuclaw commented Feb 6, 2016

Nice optimization. :-)

@ibuclaw
Copy link
Member

ibuclaw commented Feb 6, 2016

Auto-merge toggled on

ibuclaw added a commit that referenced this pull request Feb 7, 2016
Issue 14992 - static array local variables always require .init
@ibuclaw ibuclaw merged commit 8388211 into dlang:master Feb 7, 2016
@9rnsr 9rnsr deleted the fix14992 branch February 7, 2016 02:30
@WalterBright
Copy link
Member

Please do refactorings as SEPARATE PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants