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 17564: Eliminate "static this" for theAllocator #5519

Merged
merged 3 commits into from
Jun 29, 2017

Conversation

s-ludwig
Copy link
Member

This switches to lazy initialization of theAllocator, so that accessing it form within shared static this works as expected.

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 28, 2017

Thanks for your pull request, @s-ludwig!

Bugzilla references

Fix Bugzilla Description
17564 std.experimental.allocator.theAllocator is null within shared static this

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

LGTM - how about targeting stable, s.t. it's part of the 2.075.0 release?

@s-ludwig
Copy link
Member Author

LGTM - how about targeting stable, s.t. it's part of the 2.075.0 release?

I originally did that, but then decided on master because it's not a regression. But thinking about it, it would simplify the matching vibe.d fix quite a lot.

@JackStouffer
Copy link
Member

Please no enhancements on stable.

@@ -462,8 +462,8 @@ interface ISharedAllocator
private shared ISharedAllocator _processAllocator;
IAllocator _threadAllocator;
Copy link
Member

Choose a reason for hiding this comment

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

Please make this private so people can't access it before it's initialized

@wilzbach
Copy link
Member

Please no enhancements on stable.

Excerpt from Bugzilla:

vibe.d needs to use "shared static this" for initialization to support the original initialization scheme for applications that it still in wide use. With 2.075.0-b1, since processAllocator now returns an ISharedAllocator, it had to switch to theAllocator where possible. However, since this returns null during the "shared static this" phase, this causes a crash on startup.

This sounds more like a blocking issue, not an enhancement ;-)

@MartinNowak MartinNowak changed the base branch from master to stable June 28, 2017 23:44
s-ludwig and others added 3 commits June 29, 2017 01:45
This switches to lazy initialization of theAllocator, so that accessing it form within `shared static this` works as expected.
@MartinNowak
Copy link
Member

Please no enhancements on stable.

Good reminder.
Low-risk bug fixes are wanted though, in particular during a beta.

@wilzbach
Copy link
Member

continuous-integration/jenkins/pr-merge — This commit cannot be built

CC @CyberShadow - yet another PR that hangs in the queue due to the project tester failures :/

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

Successfully merging this pull request may close these issues.

5 participants