about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorRoy Frostig <rfrostig@mozilla.com>2010-09-03 16:25:56 -0700
committerRoy Frostig <rfrostig@mozilla.com>2010-09-03 16:25:56 -0700
commit974092c5265ac6ed500bdf277412461f092fda96 (patch)
tree270bc6d8fc07a7e447fa5e741c9bb425ccc05d94 /src/lib
parent4e355aebf7c0987c3d6f66ca0013e7023aa501dd (diff)
Test multi-ref'ed vec growth more seriously than before.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/_vec.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs
index 5f1d2baaeb4..39dc8617261 100644
--- a/src/lib/_vec.rs
+++ b/src/lib/_vec.rs
@@ -29,6 +29,11 @@ fn alloc[T](uint n_elts) -> vec[T] {
   ret rustrt.vec_alloc[vec[T], T](n_elts);
 }
 
+fn refcount[T](vec[T] v) -> uint {
+  // -1 because calling this function incremented the refcount.
+  ret rustrt.refcount[T](v) - 1u;
+}
+
 type init_op[T] = fn(uint i) -> T;
 
 fn init_fn[T](&init_op[T] op, uint n_elts) -> vec[T] {