Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
shrapnel
Commits
4757741e
Commit
4757741e
authored
Nov 30, 2011
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use SHRAP_STACK_PAD to get correct 16-byte alignment (x86,osx)
parent
c0f4ba01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
coro/_coro.pyx
coro/_coro.pyx
+6
-5
No files found.
coro/_coro.pyx
View file @
4757741e
...
@@ -195,6 +195,7 @@ cdef extern int __swap (void * ts, void * fs)
...
@@ -195,6 +195,7 @@ cdef extern int __swap (void * ts, void * fs)
cdef
extern
object
void_as_object
(
void
*
p
)
cdef
extern
object
void_as_object
(
void
*
p
)
cdef
extern
int
frame_getlineno
(
object
frame
)
cdef
extern
int
frame_getlineno
(
object
frame
)
cdef
extern
int
coro_breakpoint
()
cdef
extern
int
coro_breakpoint
()
cdef
extern
int
SHRAP_STACK_PAD
# forward
# forward
cdef
public
class
sched
[
object
sched_object
,
type
sched_type
]
cdef
public
class
sched
[
object
sched_object
,
type
sched_type
]
...
@@ -320,13 +321,13 @@ cdef public class coro [ object _coro_object, type _coro_type ]:
...
@@ -320,13 +321,13 @@ cdef public class coro [ object _coro_object, type _coro_type ]:
# a requirement on the amd64. [Normally the compiler would take
# a requirement on the amd64. [Normally the compiler would take
# care of this for us...]
# care of this for us...]
#
#
stack_top
=
<
void
**>
(
the_scheduler
.
stack_base
+
the_scheduler
.
stack_size
)
stack_top
=
<
void
**>
(
the_scheduler
.
stack_base
+
(
the_scheduler
.
stack_size
-
SHRAP_STACK_PAD
)
)
# bogus return address
# bogus return address
stack_top
[
-
3
]
=
<
void
*>
NULL
stack_top
[
-
2
]
=
<
void
*>
NULL
# simulate "_wrap0 (<co>)"
# simulate "_wrap0 (<co>)"
stack_top
[
-
2
]
=
<
void
*>
self
stack_top
[
-
1
]
=
<
void
*>
self
self
.
state
.
stack_pointer
=
<
void
*>
stack_top
-
(
4
*
sizeof
(
void
*
)
)
self
.
state
.
stack_pointer
=
&
(
stack_top
[
-
3
]
)
self
.
state
.
frame_pointer
=
<
void
*>
stack_top
-
(
3
*
sizeof
(
void
*
)
)
self
.
state
.
frame_pointer
=
&
(
stack_top
[
-
2
]
)
self
.
state
.
insn_pointer
=
<
void
*>
_wrap0
self
.
state
.
insn_pointer
=
<
void
*>
_wrap0
cdef
__destroy
(
self
):
cdef
__destroy
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment