Skip to content

Commit

Permalink
different sized stack, different calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfwood committed Mar 10, 2013
1 parent 467321f commit a8f14cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libos/libdeepmajik/threadscheduler.d
Expand Up @@ -232,7 +232,7 @@ align(1) struct XombThread {
XombThread* threadCreate(void* functionPointer){
ubyte* stackptr = UserspaceMemoryManager.getPage(true);

XombThread* thread = cast(XombThread*)(stackptr + 4096 - XombThread.sizeof);
XombThread* thread = cast(XombThread*)(stackptr - XombThread.sizeof);

thread.rsp = cast(ubyte*)thread - ulong.sizeof;
*(cast(ulong*)thread.rsp) = cast(ulong) &threadExit;
Expand Down

0 comments on commit a8f14cb

Please sign in to comment.