-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Unique cleanup #4763
Conversation
| { | ||
| import core.memory : GC; | ||
| destroy(_p); | ||
| GC.free(cast(void*) _p); |
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.
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.
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.
destroy is enough here
Current coverage is 88.83% (diff: 100%)@@ 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
|
a5a7a8c to
ebecfba
Compare
| /** Forwards member access to contents. */ | ||
| auto opDot() inout { return _p; } | ||
| mixin Proxy!_p; |
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.
Pretty sure Proxy can only be used with lvalues, but p can be an lvalue or an rvalue
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.
_p is a member variable. In what circumstances would it be an rvalue?
|
@tmccombs this is getting there, could you respond to @JackStouffer and take this to the finish line? Thx! |
ebecfba to
ae8fa4e
Compare
|
Auto-merge toggled on |
Clean up a couple of deprecated features used in Unique.