stdlib: Introduce an ivec module into the standard library; add a minimal test case
This commit is contained in:
parent
94cd2985b2
commit
050f62983d
5 changed files with 53 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue