about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDaan Sprenkels <dsprenkels@gmail.com>2016-11-04 22:50:54 +0100
committerDaan Sprenkels <dsprenkels@gmail.com>2016-11-06 20:07:28 +0100
commit99aaccd32fe7b63366fa13b48f485fd1cdcd8660 (patch)
treea9170fc28e48e426096662ff6d6588dd84fc06e9 /src/liballoc
parent5fe733a15945b7599fdf820ceec1597259dd8490 (diff)
downloadrust-99aaccd32fe7b63366fa13b48f485fd1cdcd8660.tar.gz
rust-99aaccd32fe7b63366fa13b48f485fd1cdcd8660.zip
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
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 7a07e007ce1..d6096d58947 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -36,6 +36,10 @@ use core::{isize, usize};
 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.