Skip to content

Commit 5d8430a

Browse files
committed
Fix a couple fails with wrong arg count (new arg from last gc change); expand vec_grow logging a bit.
1 parent f300ca4 commit 5d8430a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/rt/rust_upcall.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ upcall_vec_grow(rust_task *task, rust_vec *v, size_t n_bytes, uintptr_t is_gc)
418418
LOG_UPCALL_ENTRY(task);
419419
rust_dom *dom = task->dom;
420420
dom->log(rust_log::UPCALL|rust_log::MEM,
421-
"upcall vec_grow(%" PRIxPTR ", %" PRIdPTR ")", v, n_bytes);
421+
"upcall vec_grow(%" PRIxPTR ", %" PRIdPTR
422+
"), alloc=%" PRIdPTR ", fill=%" PRIdPTR,
423+
v, n_bytes, v->alloc, v->fill);
422424
size_t alloc = next_power_of_two(sizeof(rust_vec) + v->fill + n_bytes);
423425
if (v->refcnt == 1) {
424426

@@ -432,7 +434,7 @@ upcall_vec_grow(rust_task *task, rust_vec *v, size_t n_bytes, uintptr_t is_gc)
432434
dom->log(rust_log::UPCALL|rust_log::MEM, "realloc path");
433435
v = (rust_vec*)dom->realloc(v, alloc);
434436
if (!v) {
435-
task->fail(3);
437+
task->fail(4);
436438
return NULL;
437439
}
438440
v->alloc = alloc;
@@ -442,7 +444,7 @@ upcall_vec_grow(rust_task *task, rust_vec *v, size_t n_bytes, uintptr_t is_gc)
442444
dom->log(rust_log::UPCALL|rust_log::MEM, "new vec path");
443445
void *mem = dom->malloc(alloc);
444446
if (!mem) {
445-
task->fail(3);
447+
task->fail(4);
446448
return NULL;
447449
}
448450
v->deref();

0 commit comments

Comments
 (0)