Skip to content

Commit 586281e

Browse files
committed
libcore: Remove stack alignment from task spawning
This is already done by the native task start code. Closes rust-lang#1324
1 parent 1bfc4e2 commit 586281e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libcore/task.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ fn unsafe_spawn_inner(-thunk: fn@(),
316316
let thunkenv: *mutable uint = cast(sp - ptrsize);
317317
*thunkfn = cast(raw_thunk.code);;
318318
*thunkenv = cast(raw_thunk.env);;
319-
// align the stack to 16 bytes
320-
(**task_ptr).stack_ptr = cast(sp - ptrsize * 4u);
319+
// Advance the stack pointer. No need to align because
320+
// the native code will do that for us
321+
(**task_ptr).stack_ptr = cast(sp - ptrsize * 2u);
321322

322323
// set up notifications if they are enabled.
323324
alt notify {

0 commit comments

Comments
 (0)