rust/src/liballoc
bors 4a217759ad Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton
This commit resolves the race condition in the `get_mut` and
`make_unique` functions, which arose through interaction with weak
pointers. The basic strategy is to "lock" the weak pointer count when
trying to establish uniqueness, by reusing the field as a simple
spinlock. The overhead for normal use of `Arc` is expected to be minimal
-- it will be *none* when only strong pointers are used, and only
requires a move from atomic increment to CAS for usage of weak pointers.

The commit also removes the `unsafe` and deprecated status of these functions.

Closes #24880

r? @alexcrichton 

cc @metajack @SimonSapin @Ms2ger
2015-07-03 01:00:31 +00:00
..
arc.rs Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton 2015-07-03 01:00:31 +00:00
boxed.rs Use Box::into_raw rather than the deprecated boxed::into_raw in tests and documentation. 2015-06-26 22:29:40 +02:00
boxed_test.rs Use Box::into_raw rather than the deprecated boxed::into_raw in tests and documentation. 2015-06-26 22:29:40 +02:00
heap.rs alloc: Split apart the global alloc feature 2015-06-17 09:06:59 -07:00
lib.rs Fallout in tests and docs from feature renamings 2015-06-17 09:07:16 -07:00
rc.rs Implement CoerceUnsized for rc::Weak 2015-07-01 15:51:17 -04:00