@@ -51,8 +51,8 @@ new_stk(rust_scheduler *sched, rust_task *task, size_t minsz)
51
51
LOGPTR (task->sched , " new stk" , (uintptr_t )stk);
52
52
memset (stk, 0 , sizeof (stk_seg));
53
53
stk->next = task->stk ;
54
- stk->limit = (uintptr_t ) &stk->data [minsz + RED_ZONE_SIZE];
55
- LOGPTR (task->sched , " stk limit " , stk->limit );
54
+ stk->end = (uintptr_t ) &stk->data [minsz + RED_ZONE_SIZE];
55
+ LOGPTR (task->sched , " stk end " , stk->end );
56
56
stk->valgrind_id =
57
57
VALGRIND_STACK_REGISTER (&stk->data [0 ],
58
58
&stk->data [minsz + RED_ZONE_SIZE]);
@@ -106,7 +106,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state,
106
106
user.notify_enabled = 0 ;
107
107
108
108
stk = new_stk (sched, this , 0 );
109
- user.rust_sp = stk->limit ;
109
+ user.rust_sp = stk->end ;
110
110
if (supervisor) {
111
111
supervisor->ref ();
112
112
}
@@ -582,7 +582,7 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
582
582
583
583
stk_seg *stk_seg = new_stk (sched, this , stk_sz + args_sz);
584
584
585
- uint8_t *new_sp = (uint8_t *)stk_seg->limit ;
585
+ uint8_t *new_sp = (uint8_t *)stk_seg->end ;
586
586
size_t sizeof_retaddr = sizeof (void *);
587
587
// Make enough room on the new stack to hold the old stack pointer
588
588
// in addition to the function arguments
@@ -608,7 +608,7 @@ rust_task::record_stack_limit() {
608
608
// account for those 256 bytes.
609
609
const unsigned LIMIT_OFFSET = 256 ;
610
610
A (sched,
611
- (uintptr_t )stk->limit - RED_ZONE_SIZE
611
+ (uintptr_t )stk->end - RED_ZONE_SIZE
612
612
- (uintptr_t )stk->data >= LIMIT_OFFSET,
613
613
" Stack size must be greater than LIMIT_OFFSET" );
614
614
record_sp (stk->data + LIMIT_OFFSET + RED_ZONE_SIZE);
@@ -627,9 +627,9 @@ rust_task::reset_stack_limit() {
627
627
uintptr_t sp = get_sp ();
628
628
// Not positive these bounds for sp are correct.
629
629
// I think that the first possible value for esp on a new
630
- // stack is stk->limit , which points one word in front of
630
+ // stack is stk->end , which points one word in front of
631
631
// the first work to be pushed onto a new stack.
632
- while (sp <= (uintptr_t )stk->data || stk->limit < sp) {
632
+ while (sp <= (uintptr_t )stk->data || stk->end < sp) {
633
633
del_stk (this , stk);
634
634
A (sched, stk != NULL , " Failed to find the current stack" );
635
635
}
0 commit comments