Skip to content

Commit 6c18c75

Browse files
committed
rt: Stop zeroing out all allocations. Unobservable perf win. Closes #2682. rs=negligible-perf-win
1 parent 7b245d4 commit 6c18c75

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/rt/rust_upcall.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ upcall_s_exchange_malloc(s_exchange_malloc_args *args) {
158158
LOG_UPCALL_ENTRY(task);
159159

160160
size_t total_size = get_box_size(args->size, args->td->align);
161-
// FIXME--does this have to be calloc? (Issue #2682)
162-
void *p = task->kernel->calloc(total_size, "exchange malloc");
161+
void *p = task->kernel->malloc(total_size, "exchange malloc");
163162

164163
rust_opaque_box *header = static_cast<rust_opaque_box*>(p);
165164
header->ref_count = -1; // This is not ref counted
@@ -234,8 +233,7 @@ upcall_s_malloc(s_malloc_args *args) {
234233
LOG_UPCALL_ENTRY(task);
235234
LOG(task, mem, "upcall malloc(0x%" PRIxPTR ")", args->td);
236235

237-
// FIXME--does this have to be calloc? (Issue #2682)
238-
rust_opaque_box *box = task->boxed.calloc(args->td, args->size);
236+
rust_opaque_box *box = task->boxed.malloc(args->td, args->size);
239237
void *body = box_body(box);
240238

241239
debug::maybe_track_origin(task, box);

0 commit comments

Comments
 (0)