diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/_vec.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs index 36b529cc..c3fc7035 100644 --- a/src/lib/_vec.rs +++ b/src/lib/_vec.rs @@ -1,7 +1,7 @@ import option.none; import option.some; -import vbuf = rustrt.vbuf; +type vbuf = rustrt.vbuf; type operator2[T,U,V] = fn(&T, &U) -> V; @@ -28,6 +28,8 @@ native "rust" mod rustrt { fn refcount[T](vec[T] v) -> uint; fn vec_print_debug_info[T](vec[T] v); + + fn vec_from_vbuf[T](vbuf v, uint n_elts) -> vec[T]; } fn alloc[T](uint n_elts) -> vec[T] { @@ -48,6 +50,10 @@ fn refcount[T](vec[mutable? T] v) -> uint { } } +unsafe fn vec_from_vbuf[T](vbuf v, uint n_elts) -> vec[T] { + ret rustrt.vec_from_vbuf[T](v, n_elts); +} + type init_op[T] = fn(uint i) -> T; fn init_fn[T](&init_op[T] op, uint n_elts) -> vec[T] { |