Skip to content

remove reference counting headers from ~ #11535

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 3 commits into from
Jan 15, 2014
Merged

remove reference counting headers from ~ #11535

merged 3 commits into from
Jan 15, 2014

Conversation

thestinger
Copy link
Contributor

Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This { ref_count, type_desc, prev, next } header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
has been left out.

The borrow_offset field can now be removed from TyDesc along with
the associated handling in the compiler.

Closes #9510
Closes #11533

@thestinger
Copy link
Contributor Author

cc @huonw, @pnkfelix, @pcwalton

@pnkfelix
Copy link
Member

�thestinger and I discussed this. I have no problem with it. (If we do decide to put the TypeDesc back in later as part of GC support, we can put it at a negative offset known only to the GC and other privileged libstd libraries.)

@alexcrichton
Copy link
Member

Can you add a test for #11532 as well?

@alexcrichton
Copy link
Member

It'd also be nice for this to have Closes #11532 in the commit message or PR description

@alexcrichton
Copy link
Member

You can also probably contain the transmutes in and out of Vec more sanely by updating unstable::raw

impl<T> Repr<*Vec<T>> for ~[T] {}

bors added a commit that referenced this pull request Jan 15, 2014
Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
 has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
@brson
Copy link
Contributor

brson commented Jan 15, 2014

Nice! Glad to see all this bloat disappear.

Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
bors added a commit that referenced this pull request Jan 15, 2014
Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
 has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
@bors bors closed this Jan 15, 2014
@bors bors merged commit 77758f0 into rust-lang:master Jan 15, 2014
@thestinger thestinger deleted the header branch January 15, 2014 08:44
@emberian
Copy link
Member

Super awesome!

flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 11, 2024
don't lint [`default_numeric_fallback`] on return and local assigned macro calls with type stated

fixes: rust-lang#11535

changelog: don't lint [`default_numeric_fallback`] on return and local assigned macro calls with type stated
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.

fix shrink_to_fit for managed-unique vectors
6 participants