Skip to content

Commit 99aaccd

Browse files
committed
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
1 parent 5fe733a commit 99aaccd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/liballoc/arc.rs

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ use core::{isize, usize};
3636
use core::convert::From;
3737
use heap::deallocate;
3838

39+
/// A soft limit on the amount of references that may be made to an `Arc`.
40+
///
41+
/// Going above this limit will abort your program (although not
42+
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
3943
const MAX_REFCOUNT: usize = (isize::MAX) as usize;
4044

4145
/// A thread-safe reference-counting pointer.

0 commit comments

Comments
 (0)