rt: Zero out allocations so that the CC won't die if it happens to run while a box is being constructed.
This is kind of unfortunate.
This commit is contained in:
parent
a63cc03a07
commit
eafb70072a
@ -68,6 +68,7 @@ upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) {
|
||||
// type_desc.
|
||||
|
||||
void *p = task->malloc(nbytes, "tdesc", td);
|
||||
memset(p, '\0', nbytes);
|
||||
|
||||
task->local_allocs[p] = td;
|
||||
|
||||
@ -101,6 +102,7 @@ upcall_shared_malloc(rust_task *task, size_t nbytes, type_desc *td) {
|
||||
"upcall shared_malloc(%" PRIdPTR ", 0x%" PRIxPTR ")",
|
||||
nbytes, td);
|
||||
void *p = task->kernel->malloc(nbytes, "shared malloc");
|
||||
memset(p, '\0', nbytes);
|
||||
LOG(task, mem,
|
||||
"upcall shared_malloc(%" PRIdPTR ", 0x%" PRIxPTR
|
||||
") = 0x%" PRIxPTR,
|
||||
|
Loading…
x
Reference in New Issue
Block a user