Remove upcall_new_vec
This commit is contained in:
parent
c2d2dad093
commit
7903daf86f
@ -37,7 +37,6 @@ type upcalls =
|
||||
shared_free: ValueRef,
|
||||
mark: ValueRef,
|
||||
new_str: ValueRef,
|
||||
new_vec: ValueRef,
|
||||
vec_append: ValueRef,
|
||||
get_type_desc: ValueRef,
|
||||
ivec_resize: ValueRef,
|
||||
@ -84,9 +83,6 @@ fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef,
|
||||
shared_free: dv("shared_free", ~[T_ptr(T_i8())]),
|
||||
mark: d("mark", ~[T_ptr(T_i8())], T_int()),
|
||||
new_str: d("new_str", ~[T_ptr(T_i8()), T_size_t()], T_ptr(T_str())),
|
||||
new_vec:
|
||||
d("new_vec", ~[T_size_t(), T_ptr(tydesc_type)],
|
||||
T_opaque_vec_ptr()),
|
||||
vec_append:
|
||||
d("vec_append",
|
||||
~[T_ptr(tydesc_type), T_ptr(tydesc_type),
|
||||
|
@ -222,24 +222,6 @@ upcall_new_str(rust_task *task, char const *s, size_t fill) {
|
||||
return make_str(task, s, fill);
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_vec *
|
||||
upcall_new_vec(rust_task *task, size_t fill, type_desc *td) {
|
||||
LOG_UPCALL_ENTRY(task);
|
||||
|
||||
rust_scheduler *sched = task->sched;
|
||||
DLOG(sched, mem, "upcall new_vec(%" PRIdPTR ")", fill);
|
||||
size_t alloc = next_power_of_two(sizeof(rust_vec) + fill);
|
||||
void *mem = task->malloc(alloc, "rust_vec (upcall_new_vec)", td);
|
||||
if (!mem) {
|
||||
task->fail();
|
||||
return NULL;
|
||||
}
|
||||
rust_vec *v = new (mem) rust_vec(alloc, 0, NULL);
|
||||
LOG(task, mem,
|
||||
"upcall new_vec(%" PRIdPTR ") = 0x%" PRIxPTR, fill, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static rust_vec *
|
||||
vec_grow(rust_task *task,
|
||||
rust_vec *v,
|
||||
|
@ -99,7 +99,6 @@ upcall_log_type
|
||||
upcall_malloc
|
||||
upcall_mark
|
||||
upcall_new_str
|
||||
upcall_new_vec
|
||||
upcall_shared_malloc
|
||||
upcall_shared_free
|
||||
upcall_sleep
|
||||
|
Loading…
x
Reference in New Issue
Block a user