aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_util.h
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-09 08:01:40 -0700
committerMichael Bebenita <[email protected]>2010-08-09 08:01:40 -0700
commit4641fcef616a7ee1eece4f00f757958757deb438 (patch)
tree9cc7c6db8e0a90cd9e10a4495aa1dd4a65193821 /src/rt/rust_util.h
parentMade ref_count signed to help detect negative ref_count bugs. (diff)
downloadrust-4641fcef616a7ee1eece4f00f757958757deb438.tar.xz
rust-4641fcef616a7ee1eece4f00f757958757deb438.zip
Added peek() to ptr_vec.
Diffstat (limited to 'src/rt/rust_util.h')
-rw-r--r--src/rt/rust_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h
index 6f2ab4c3..03b7766d 100644
--- a/src/rt/rust_util.h
+++ b/src/rt/rust_util.h
@@ -70,6 +70,13 @@ ptr_vec<T>::pop()
}
template <typename T>
+T *
+ptr_vec<T>::peek()
+{
+ return data[fill - 1];
+}
+
+template <typename T>
void
ptr_vec<T>::trim(size_t sz)
{