Remove unused tydesc argument to upcall_shared_malloc
This commit is contained in:
parent
389aff333d
commit
b1d7f252a9
4 changed files with 10 additions and 23 deletions
|
@ -57,20 +57,17 @@ fn declare_upcalls(targ_cfg: @session::config,
|
|||
T_ptr(T_i8()),
|
||||
size_t]),
|
||||
malloc:
|
||||
d("malloc", [T_ptr(tydesc_type)],
|
||||
T_ptr(T_i8())),
|
||||
d("malloc", [T_ptr(tydesc_type)], T_ptr(T_i8())),
|
||||
free:
|
||||
dv("free", [T_ptr(T_i8())]),
|
||||
validate_box:
|
||||
dv("validate_box", [T_ptr(T_i8())]),
|
||||
shared_malloc:
|
||||
d("shared_malloc", [size_t, T_ptr(tydesc_type)],
|
||||
T_ptr(T_i8())),
|
||||
d("shared_malloc", [size_t], T_ptr(T_i8())),
|
||||
shared_free:
|
||||
dv("shared_free", [T_ptr(T_i8())]),
|
||||
shared_realloc:
|
||||
d("shared_realloc", [T_ptr(T_i8()), size_t],
|
||||
T_ptr(T_i8())),
|
||||
d("shared_realloc", [T_ptr(T_i8()), size_t], T_ptr(T_i8())),
|
||||
mark:
|
||||
d("mark", [T_ptr(T_i8())], int_t),
|
||||
create_shared_type_desc:
|
||||
|
|
|
@ -481,12 +481,7 @@ fn GEP_enum(cx: block, llblobptr: ValueRef, enum_id: ast::def_id,
|
|||
// and a size indicating how much space we want malloc'd.
|
||||
fn trans_shared_malloc(cx: block, llptr_ty: TypeRef, llsize: ValueRef)
|
||||
-> result {
|
||||
// FIXME: need a table to collect tydesc globals.
|
||||
|
||||
let tydesc = C_null(T_ptr(cx.ccx().tydesc_type));
|
||||
let rval =
|
||||
Call(cx, cx.ccx().upcalls.shared_malloc,
|
||||
[llsize, tydesc]);
|
||||
let rval = Call(cx, cx.ccx().upcalls.shared_malloc, [llsize]);
|
||||
ret rslt(cx, PointerCast(cx, rval, llptr_ty));
|
||||
}
|
||||
|
||||
|
|
|
@ -627,7 +627,7 @@ fn make_opaque_cbox_take_glue(
|
|||
|
||||
// Allocate memory, update original ptr, and copy existing data
|
||||
let malloc = ccx.upcalls.shared_malloc;
|
||||
let cbox_out = Call(bcx, malloc, [sz, tydesc]);
|
||||
let cbox_out = Call(bcx, malloc, [sz]);
|
||||
let cbox_out = PointerCast(bcx, cbox_out, llopaquecboxty);
|
||||
let {bcx, val: _} = call_memmove(bcx, cbox_out, cbox_in, sz);
|
||||
Store(bcx, cbox_out, cboxptr);
|
||||
|
|
|
@ -217,7 +217,6 @@ upcall_validate_box(rust_opaque_box* ptr) {
|
|||
struct s_shared_malloc_args {
|
||||
uintptr_t retval;
|
||||
size_t nbytes;
|
||||
type_desc *td;
|
||||
};
|
||||
|
||||
extern "C" CDECL void
|
||||
|
@ -225,21 +224,17 @@ upcall_s_shared_malloc(s_shared_malloc_args *args) {
|
|||
rust_task *task = rust_task_thread::get_task();
|
||||
LOG_UPCALL_ENTRY(task);
|
||||
|
||||
LOG(task, mem,
|
||||
"upcall shared_malloc(%" PRIdPTR ", 0x%" PRIxPTR ")",
|
||||
args->nbytes, args->td);
|
||||
LOG(task, mem, "upcall shared_malloc(%" PRIdPTR ")", args->nbytes);
|
||||
void *p = task->kernel->malloc(args->nbytes, "shared malloc");
|
||||
memset(p, '\0', args->nbytes);
|
||||
LOG(task, mem,
|
||||
"upcall shared_malloc(%" PRIdPTR ", 0x%" PRIxPTR
|
||||
") = 0x%" PRIxPTR,
|
||||
args->nbytes, args->td, (uintptr_t)p);
|
||||
LOG(task, mem, "upcall shared_malloc(%" PRIdPTR ") = 0x%" PRIxPTR,
|
||||
args->nbytes, (uintptr_t)p);
|
||||
args->retval = (uintptr_t) p;
|
||||
}
|
||||
|
||||
extern "C" CDECL uintptr_t
|
||||
upcall_shared_malloc(size_t nbytes, type_desc *td) {
|
||||
s_shared_malloc_args args = {0, nbytes, td};
|
||||
upcall_shared_malloc(size_t nbytes) {
|
||||
s_shared_malloc_args args = {0, nbytes};
|
||||
UPCALL_SWITCH_STACK(&args, upcall_s_shared_malloc);
|
||||
return args.retval;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue