Add a comment to Arc::MAX_REFCOUNT

The constant name `MAX_REFCOUNT` suggests that the value is a
_hard_ limit on the amount of references to an `Arc`. This is
a more soft limit however. This commit adds a comment to the
constant to annotate this.

See also: PR #37605
This commit is contained in:
Daan Sprenkels 2016-11-04 22:50:54 +01:00
parent 5fe733a159
commit 99aaccd32f

View File

@ -36,6 +36,10 @@
use core::convert::From;
use heap::deallocate;
/// A soft limit on the amount of references that may be made to an `Arc`.
///
/// Going above this limit will abort your program (although not
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
const MAX_REFCOUNT: usize = (isize::MAX) as usize;
/// A thread-safe reference-counting pointer.