diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp index 42b2e490404..601a7c3f0ef 100644 --- a/src/rt/rust_scheduler.cpp +++ b/src/rt/rust_scheduler.cpp @@ -286,7 +286,6 @@ rust_scheduler::start_main_loop() { scheduled_task->state->name); place_task_in_tls(scheduled_task); - //pthread_setspecific(89, (void *)scheduled_task->stk->limit); interrupt_flag = 0; diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 888c9ac701a..0f97a0a6853 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -51,8 +51,8 @@ new_stk(rust_scheduler *sched, rust_task *task, size_t minsz) LOGPTR(task->sched, "new stk", (uintptr_t)stk); memset(stk, 0, sizeof(stk_seg)); stk->next = task->stk; - stk->limit = (uintptr_t) &stk->data[minsz + RED_ZONE_SIZE]; - LOGPTR(task->sched, "stk limit", stk->limit); + stk->end = (uintptr_t) &stk->data[minsz + RED_ZONE_SIZE]; + LOGPTR(task->sched, "stk end", stk->end); stk->valgrind_id = VALGRIND_STACK_REGISTER(&stk->data[0], &stk->data[minsz + RED_ZONE_SIZE]); @@ -106,7 +106,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state, user.notify_enabled = 0; stk = new_stk(sched, this, 0); - user.rust_sp = stk->limit; + user.rust_sp = stk->end; if (supervisor) { supervisor->ref(); } @@ -582,7 +582,7 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) { stk_seg *stk_seg = new_stk(sched, this, stk_sz + args_sz); - uint8_t *new_sp = (uint8_t*)stk_seg->limit; + uint8_t *new_sp = (uint8_t*)stk_seg->end; size_t sizeof_retaddr = sizeof(void*); // Make enough room on the new stack to hold the old stack pointer // in addition to the function arguments @@ -608,7 +608,7 @@ rust_task::record_stack_limit() { // account for those 256 bytes. const unsigned LIMIT_OFFSET = 256; A(sched, - (uintptr_t)stk->limit - RED_ZONE_SIZE + (uintptr_t)stk->end - RED_ZONE_SIZE - (uintptr_t)stk->data >= LIMIT_OFFSET, "Stack size must be greater than LIMIT_OFFSET"); record_sp(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE); @@ -627,9 +627,9 @@ rust_task::reset_stack_limit() { uintptr_t sp = get_sp(); // Not positive these bounds for sp are correct. // I think that the first possible value for esp on a new - // stack is stk->limit, which points one word in front of + // stack is stk->end, which points one word in front of // the first work to be pushed onto a new stack. - while (sp <= (uintptr_t)stk->data || stk->limit < sp) { + while (sp <= (uintptr_t)stk->data || stk->end < sp) { del_stk(this, stk); A(sched, stk != NULL, "Failed to find the current stack"); } diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 47472801510..3d5cbff9910 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -25,7 +25,7 @@ struct rust_box; struct stk_seg { stk_seg *next; - uintptr_t limit; + uintptr_t end; unsigned int valgrind_id; #ifndef _LP64 uint32_t pad;