diff options
| author | Roy Frostig <[email protected]> | 2010-07-22 17:47:32 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-07-22 17:47:32 -0700 |
| commit | 1730d2e037fc41f31d0a90b2fde477f02f0fc798 (patch) | |
| tree | 4e920841841b4cbf35862f3db41db7f688ffffa9 /src/lib | |
| parent | A certain incomplete quantity of wrestling with "INIT" statements that don't ... (diff) | |
| download | rust-1730d2e037fc41f31d0a90b2fde477f02f0fc798.tar.xz rust-1730d2e037fc41f31d0a90b2fde477f02f0fc798.zip | |
Notify copy glue of dst-initialization and fix _vec.alloc issues in lib and runtime. Closes #109.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/_vec.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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; |