Skip to content

Commit 89812f9

Browse files
committed
---
yaml --- r: 6603 b: refs/heads/master c: 5d1a1dc h: refs/heads/master i: 6601: c236ccb 6599: 65c09cf v: v3
1 parent b81c3b8 commit 89812f9

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3d7b89bc4dc63632ee0003869811933ddc1962e9
2+
refs/heads/master: 5d1a1dc4203f8ae77e2e9c5cba393887f0b7d762

trunk/src/rt/rust_scheduler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ rust_scheduler::start_main_loop() {
286286
scheduled_task->state->name);
287287

288288
place_task_in_tls(scheduled_task);
289-
//pthread_setspecific(89, (void *)scheduled_task->stk->limit);
290289

291290
interrupt_flag = 0;
292291

trunk/src/rt/rust_task.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ new_stk(rust_scheduler *sched, rust_task *task, size_t minsz)
5151
LOGPTR(task->sched, "new stk", (uintptr_t)stk);
5252
memset(stk, 0, sizeof(stk_seg));
5353
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);
5656
stk->valgrind_id =
5757
VALGRIND_STACK_REGISTER(&stk->data[0],
5858
&stk->data[minsz + RED_ZONE_SIZE]);
@@ -106,7 +106,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state,
106106
user.notify_enabled = 0;
107107

108108
stk = new_stk(sched, this, 0);
109-
user.rust_sp = stk->limit;
109+
user.rust_sp = stk->end;
110110
if (supervisor) {
111111
supervisor->ref();
112112
}
@@ -582,7 +582,7 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
582582

583583
stk_seg *stk_seg = new_stk(sched, this, stk_sz + args_sz);
584584

585-
uint8_t *new_sp = (uint8_t*)stk_seg->limit;
585+
uint8_t *new_sp = (uint8_t*)stk_seg->end;
586586
size_t sizeof_retaddr = sizeof(void*);
587587
// Make enough room on the new stack to hold the old stack pointer
588588
// in addition to the function arguments
@@ -608,7 +608,7 @@ rust_task::record_stack_limit() {
608608
// account for those 256 bytes.
609609
const unsigned LIMIT_OFFSET = 256;
610610
A(sched,
611-
(uintptr_t)stk->limit - RED_ZONE_SIZE
611+
(uintptr_t)stk->end - RED_ZONE_SIZE
612612
- (uintptr_t)stk->data >= LIMIT_OFFSET,
613613
"Stack size must be greater than LIMIT_OFFSET");
614614
record_sp(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE);
@@ -627,9 +627,9 @@ rust_task::reset_stack_limit() {
627627
uintptr_t sp = get_sp();
628628
// Not positive these bounds for sp are correct.
629629
// 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
631631
// 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) {
633633
del_stk(this, stk);
634634
A(sched, stk != NULL, "Failed to find the current stack");
635635
}

trunk/src/rt/rust_task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct rust_box;
2525

2626
struct stk_seg {
2727
stk_seg *next;
28-
uintptr_t limit;
28+
uintptr_t end;
2929
unsigned int valgrind_id;
3030
#ifndef _LP64
3131
uint32_t pad;

0 commit comments

Comments
 (0)