Skip to content

Move sys::refcount to managed::refcount #9922

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

Merged
merged 1 commit into from
Oct 18, 2013
Merged

Conversation

alexcrichton
Copy link
Member

More progress on #2240

bors added a commit that referenced this pull request Oct 18, 2013
@bors bors closed this Oct 18, 2013
@bors bors merged commit 82f5f65 into rust-lang:master Oct 18, 2013
pub fn refcount<T>(t: @T) -> uint {
unsafe {
let ref_ptr: *uint = cast::transmute_copy(&t);
*ref_ptr - 1
Copy link
Member

Choose a reason for hiding this comment

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

A one is subtracted here, does the new version have the same behavior? (I can't tell)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, I appear to not have refactored the code correctly. Good catch!

Copy link
Member

Choose a reason for hiding this comment

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

Worthy of a test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 18, 2013
This fixes a bug I accidentally introduced in rust-lang#9922
bors added a commit that referenced this pull request Oct 18, 2013
This fixes a bug I accidentally introduced in #9922
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