From 1730d2e037fc41f31d0a90b2fde477f02f0fc798 Mon Sep 17 00:00:00 2001 From: Roy Frostig Date: Thu, 22 Jul 2010 17:47:32 -0700 Subject: Notify copy glue of dst-initialization and fix _vec.alloc issues in lib and runtime. Closes #109. --- src/lib/_vec.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs index c0555bf1..849e750a 100644 --- a/src/lib/_vec.rs +++ b/src/lib/_vec.rs @@ -5,12 +5,15 @@ native "rust" mod rustrt { type vbuf; fn vec_buf[T](vec[T] v) -> vbuf; fn vec_len[T](vec[T] v) -> uint; - fn vec_alloc[T](uint n_elts) -> vec[T]; + /* The T in vec_alloc[T, U] is the type of the vec to allocate. The + * U is the type of an element in the vec. So to allocate a vec[U] we + * want to invoke this as vec_alloc[vec[U], U]. */ + fn vec_alloc[T, U](uint n_elts) -> vec[U]; fn refcount[T](vec[T] v) -> uint; } fn alloc[T](uint n_elts) -> vec[T] { - ret rustrt.vec_alloc[T](n_elts); + ret rustrt.vec_alloc[vec[T], T](n_elts); } type init_op[T] = fn(uint i) -> T; -- cgit v1.2.3