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/rust_builtin.cpp | |
| 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/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 7 |
1 files changed, 7 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) { |