about summary refs log tree commit diff
path: root/src/libstd/rc.rs
AgeCommit message (Collapse)AuthorLines
2014-05-17std: Refactor liballoc out of lib{std,sync}Alex Crichton-300/+0
This commit is part of the libstd facade RFC, issue #13851. This creates a new library, liballoc, which is intended to be the core allocation library for all of Rust. It is pinned on the basic assumption that an allocation failure is an abort or failure. This module has inherited the heap/libc_heap modules from std::rt, the owned/rc modules from std, and the arc module from libsync. These three pointers are currently the three most core pointer implementations in Rust. The UnsafeArc type in std::sync should be considered deprecated and replaced by Arc<Unsafe<T>>. This commit does not currently migrate to this type, but future commits will continue this refactoring.
2014-05-11heap: replace `exchange_free` with `deallocate`Daniel Micay-5/+5
The `std::rt::heap` API is Rust's global allocator, so there's no need to have this as a separate API.
2014-05-11core: Remove the cast moduleAlex Crichton-1/+1
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-10initial port of the exchange allocator to jemallocDaniel Micay-3/+6
In stage0, all allocations are 8-byte aligned. Passing a size and alignment to free is not yet implemented everywhere (0 size and 8 align are used as placeholders). Fixing this is part of #13994. Closes #13616
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-04-23Hide trait rc::RcBoxPtr from docsEdward Wang-1/+1
It is for internal use only and should not appear in docs.
2014-03-31std: Switch field privacy as necessaryAlex Crichton-6/+6
2014-03-23use TotalEq for HashMapDaniel Micay-1/+8
Closes #5283
2014-03-22rustc: Remove all usage of manual deref()Alex Crichton-13/+12
Favor using '*' instead
2014-03-22std: Remove the get() method from RefCell wrappersAlex Crichton-1/+1
This method has been entirely obsoleted by autoderef, so there's no reason for its existence.
2014-03-22auto merge of #13052 : sfackler/rust/clean-refcell, r=alexcrichtonbors-4/+2
These are superfluous now that we have fixed rvalue lifetimes and Deref. I'd also like to kill off `get` and `set`, but that'll be a large change so I want to make sure that we actually want to do that first.
2014-03-21Rewrite rc::Rc using cell::CellEdward Wang-34/+65
Since `Arc` has been using `Atomic`, this closes 12625. Closes #12625.
2014-03-20Remove RefCell::{with, with_mut}Steven Fackler-4/+2
These are superfluous now that we have fixed rvalue lifetimes and Deref.
2014-03-20Make `Rc`, `Cell` and `RefCell` NoShareFlavio Percoco-7/+14
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-21/+15
Rc<RefCell<T>>.
2014-03-08Removed DeepClone. Issue #12698.Michael Darakananda-18/+1
2014-03-04Implement DerefImm for Rc and DerefImm/DerefMut for RefCell's Ref/RefMut.Eduard Burtescu-1/+9
2014-02-15std: clean up ptr a bitCorey Richardson-5/+5
2014-02-06Ensure an Rc isn't freed while running its own destructor.Huon Wilson-2/+27
A weak pointer inside itself will have its destructor run when the last strong pointer to that data disappears, so we need to make sure that the Weak and Rc destructors don't duplicate work (i.e. freeing). By making the Rcs effectively take a weak pointer, we ensure that no Weak destructor will free the pointer while still ensuring that Weak pointers can't be upgraded to strong ones as the destructors run. This approach of starting weak at 1 is what libstdc++ does. Fixes #12046.
2014-01-31Introduce marker types for indicating variance and for opting outNiko Matsakis-9/+13
of builtin bounds. Fixes #10834. Fixes #11385. cc #5922.
2014-01-22Replace C types with Rust types in libstd, closes #7313Florian Hahn-2/+2
2014-01-14remove reference counting headers from ~Daniel Micay-0/+8
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
2014-01-09port over the old tests to the new `Rc`Daniel Micay-1/+42
2014-01-09rename Strong -> Rc, replacing `rc` with `weak`Daniel Micay-96/+102
2014-01-09stop treating `Rc` cycles as unsafeDaniel Micay-45/+9
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-0/+1
2013-12-27std: uniform modules titles for docLuca Bruno-1/+1
This commit uniforms the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index. Signed-off-by: Luca Bruno <lucab@debian.org>
2013-11-26librustc: Fix merge fallout.Patrick Walton-22/+0
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-4/+26
2013-11-24Implement cmp traits for Rc<T> and add a ptr_eq method.Léo Testard-0/+55
2013-11-23Move mutable::Mut to cell::RefCellSteven Fackler-8/+8
2013-11-22Add Rc::from_mutSteven Fackler-0/+17
2013-11-22Change Mut::map to Mut::withSteven Fackler-4/+4
2013-11-22Move Rc tests away from CellSteven Fackler-7/+7
2013-11-22Remove RcMutSteven Fackler-237/+0
Rc<Mut<T>> should be used instead
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-2/+2
2013-11-07add `from_send` to Rc, since #9509 is fixedDaniel Micay-21/+24
2013-10-12rc: fix docstringDaniel Micay-1/+1
2013-10-11clean up the `Rc`/`RcMut` types and move to libstdDaniel Micay-0/+383
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-368/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Register snapshotsBrian Anderson-32/+0
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-1/+1
2013-05-15allow constructing Rc/RcMut from Const types tooDaniel Micay-42/+66
2013-05-15rc: fix testsDaniel Micay-15/+7
2013-05-15add a DeepClone traitDaniel Micay-4/+80
for deep copies through shared ownership boundaries
2013-05-12libsyntax: Remove `extern mod foo { ... }` from the language.Patrick Walton-2/+9
2013-05-10Stop using the '<->' operatorAlex Crichton-15/+5
2013-05-09Add intrinsic declaration where I missed themJames Miller-0/+2
2013-05-09Make staged versions of the functions that use uninitJames Miller-0/+33
2013-05-09Replace init() with uninit() where appropriateJames Miller-2/+2