Skip to content

Commit 2e6c98f

Browse files
committed
---
yaml --- r: 13143 b: refs/heads/master c: b16bdd9 h: refs/heads/master i: 13141: 64a7e2a 13139: caaaadc 13135: f77ceff v: v3
1 parent 74ed3bd commit 2e6c98f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a2bbdd3f52a71beabc1beb964772d30045cbe949
2+
refs/heads/master: b16bdd9ed097ea91a71f3bbffbad4c5e7d57722e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rt/rust_upcall.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,16 @@ exchange_malloc(rust_task *task, type_desc *td, uintptr_t size) {
164164
size_t header_size = sizeof(rust_opaque_box);
165165
size_t body_size = size;
166166
size_t body_align = td->align;
167+
// FIXME: This alignment calculation is suspicious. Is it right?
167168
size_t total_size = align_to(header_size, body_align) + body_size;
168169

169170
void *p = task->kernel->malloc(total_size, "exchange malloc");
170-
memset(p, '\0', total_size);
171171

172172
rust_opaque_box *header = static_cast<rust_opaque_box*>(p);
173173
header->td = td;
174174

175+
memset(&header[1], '\0', body_size);
176+
175177
return (uintptr_t)header;
176178
}
177179

0 commit comments

Comments
 (0)