rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; XFAIL use-import-export.rs in rustc

This commit is contained in:
Patrick Walton
2011-03-24 17:21:09 -07:00
parent 29d853dd19
commit af3d0d1848
7 changed files with 53 additions and 9 deletions

View File

@@ -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)
{