1
Fork 0

stdlib: Introduce an ivec module into the standard library; add a minimal test case

This commit is contained in:
Patrick Walton 2011-06-16 16:08:26 -07:00
parent 94cd2985b2
commit 050f62983d
5 changed files with 53 additions and 0 deletions

View file

@ -606,6 +606,16 @@ ivec_reserve(rust_task *task, type_desc *ty, rust_ivec *v, size_t n_elems)
v->alloc = new_alloc;
}
/**
* Returns true if the given vector is on the heap and false if it's on the
* stack.
*/
extern "C" bool
ivec_on_heap(rust_task *task, type_desc *ty, rust_ivec *v)
{
return !v->fill && v->payload.ptr;
}
//
// Local Variables: