diff options
| author | Patrick Walton <[email protected]> | 2011-03-24 17:21:09 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-24 17:22:07 -0700 |
| commit | af3d0d1848116f0e29dcaf8859d27fd4555f3444 (patch) | |
| tree | 18984d72de2f122692b820259e06504621c42842 /src/rt | |
| parent | Remove obsolete Makefiles. (diff) | |
| download | rust-af3d0d1848116f0e29dcaf8859d27fd4555f3444.tar.xz rust-af3d0d1848116f0e29dcaf8859d27fd4555f3444.zip | |
rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; XFAIL use-import-export.rs in rustc
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 7 | ||||
| -rw-r--r-- | src/rt/rustrt.def.in | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 1d8f8ba8..98333774 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -170,6 +170,13 @@ vec_alloc_with_data(rust_task *task, return new (mem) rust_vec(dom, alloc, fill * elt_size, (uint8_t*)d); } +extern "C" CDECL rust_vec* +vec_from_vbuf(rust_task *task, type_desc *ty, void *vbuf, size_t n_elts) +{ + return vec_alloc_with_data(task, n_elts, n_elts * ty->size, ty->size, + vbuf); +} + extern "C" CDECL rust_str* str_alloc(rust_task *task, size_t n_bytes) { diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 1f081605..d917aa93 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -62,6 +62,7 @@ upcall_yield vec_alloc vec_alloc_mut vec_buf +vec_from_vbuf vec_len vec_len_set vec_print_debug_info |