about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-06 03:11:39 -0800
committerbors <bors@rust-lang.org>2014-02-06 03:11:39 -0800
commit9a9a70b3fde3690e710fddb3d5d3b2f580ee07fb (patch)
tree97f0a3b33b17e5107670293581db0b77cb46daee /src/rustllvm/RustWrapper.cpp
parentd8c4e78603eb1f658516dde08868abbe6c06bd35 (diff)
parentda45340ab84603cf6932b012b977bc2e7b8d6764 (diff)
downloadrust-9a9a70b3fde3690e710fddb3d5d3b2f580ee07fb.tar.gz
rust-9a9a70b3fde3690e710fddb3d5d3b2f580ee07fb.zip
auto merge of #12047 : huonw/rust/cyclic-rc, r=thestinger
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions