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

Unique cleanup #4763

Merged
merged 2 commits into from
Oct 1, 2016
Merged

Unique cleanup #4763

merged 2 commits into from
Oct 1, 2016

Conversation

tmccombs
Copy link
Contributor

@tmccombs tmccombs commented Sep 5, 2016

Clean up a couple of deprecated features used in Unique.

{
import core.memory : GC;
destroy(_p);
GC.free(cast(void*) _p);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure if the GC.free should be here. It seems consistent with the previous behavior, and my expectation would be that Unique should free the memory it is holding when it goes out of scope, but opAssign only calls destroy not GC.free.

Copy link
Member

Choose a reason for hiding this comment

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

destroy is enough here

@codecov-io
Copy link

codecov-io commented Sep 8, 2016

Current coverage is 88.83% (diff: 100%)

Merging #4763 into master will increase coverage by 0.22%

@@             master      #4763   diff @@
==========================================
  Files           124        121      -3   
  Lines         77300      74283   -3017   
  Methods           0          0           
  Messages          0          0           
  Branches          0          0           
==========================================
- Hits          68495      65988   -2507   
+ Misses         8805       8295    -510   
  Partials          0          0           

Powered by Codecov. Last update 76cd4bd...ebecfba

@tmccombs tmccombs force-pushed the unique-cleanup branch 2 times, most recently from a5a7a8c to ebecfba Compare September 8, 2016 06:08
/** Forwards member access to contents. */
auto opDot() inout { return _p; }
mixin Proxy!_p;
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure Proxy can only be used with lvalues, but p can be an lvalue or an rvalue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_p is a member variable. In what circumstances would it be an rvalue?

@andralex
Copy link
Member

@tmccombs this is getting there, could you respond to @JackStouffer and take this to the finish line? Thx!

@andralex
Copy link
Member

andralex commented Oct 1, 2016

Auto-merge toggled on

@andralex andralex merged commit ace0b93 into dlang:master Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants