Create some infrastructure for building up @-vectors. Work on #2921.
This commit is contained in:
@@ -62,6 +62,16 @@ vec_data(rust_vec *v) {
|
||||
return reinterpret_cast<T*>(v->data);
|
||||
}
|
||||
|
||||
inline void reserve_vec_exact_shared(rust_task* task, rust_vec_box** vpp,
|
||||
size_t size) {
|
||||
rust_opaque_box** ovpp = (rust_opaque_box**)vpp;
|
||||
if (size > (*vpp)->body.alloc) {
|
||||
*vpp = (rust_vec_box*)task->boxed.realloc(
|
||||
*ovpp, size + sizeof(rust_vec));
|
||||
(*vpp)->body.alloc = size;
|
||||
}
|
||||
}
|
||||
|
||||
inline void reserve_vec_exact(rust_task* task, rust_vec_box** vpp,
|
||||
size_t size) {
|
||||
if (size > (*vpp)->body.alloc) {
|
||||
|
||||
Reference in New Issue
Block a user