Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
70571ff4
Commit
70571ff4
authored
Mar 15, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on this
parent
03e6d17c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
17 deletions
+57
-17
docs/REFCOUNTING.md
docs/REFCOUNTING.md
+1
-1
pyston_gdbinit.txt
pyston_gdbinit.txt
+4
-0
test/tests/descr_selfdelete.py
test/tests/descr_selfdelete.py
+52
-16
No files found.
docs/REFCOUNTING.md
View file @
70571ff4
...
...
@@ -15,7 +15,7 @@ Unless specified, arguments are borrowed and return values are owned. This can
Exception safety
Helpers:
AUTO_DECREF, autoDecref, incref
AUTO_DECREF, autoDecref, incref
. DecrefHandle
Invariant: all paths through a function should leave each variable with 0 net refs. (This includes paths out via exceptions.)
...
...
pyston_gdbinit.txt
View file @
70571ff4
...
...
@@ -2,6 +2,10 @@ handle SIGUSR2 pass nostop noprint
skip file /usr/include/c++/4.8/bits/stl_vector.h
skip file /usr/include/c++/4.9/bits/stl_vector.h
skip file /usr/include/c++/4.8/bits/unique_ptr.h
skip file /usr/include/c++/4.9/bits/unique_ptr.h
skip file /usr/include/c++/4.8/bits/move.h
skip file /usr/include/c++/4.9/bits/move.h
skip pyston::ArgPassSpec::ArgPassSpec(int, int, bool, bool)
skip pyston::InternedString::getBox() const
...
...
test/tests/descr_selfdelete.py
View file @
70571ff4
...
...
@@ -24,16 +24,20 @@ def make_closure(f):
return
r
return
inner
# The standard case, when the function is obtained via standard evaluation rules:
class
C
(
object
):
@
make_closure
def
f
(
self
,
other_arg
=
2.5
**
10
):
print
"f"
print
other_arg
del
C
.
f
print
other_arg
c
=
C
()
c
.
f
()
def
f
():
# The standard case, when the function is obtained via standard evaluation rules:
class
C
(
object
):
@
make_closure
def
f
(
self
,
other_arg
=
2.5
**
10
):
print
"f"
print
other_arg
del
C
.
f
print
other_arg
c
=
C
()
c
.
f
()
f
()
f
()
f
()
def
f
():
class
C
(
object
):
...
...
@@ -53,6 +57,7 @@ def f():
print
e
f
()
f
()
f
()
def
f
():
class
C
(
object
):
...
...
@@ -73,6 +78,7 @@ def f():
print
e
f
()
f
()
f
()
def
f
():
class
C
(
object
):
...
...
@@ -92,9 +98,12 @@ def f():
print
e
f
()
f
()
f
()
def
f
():
class
C
(
object
):
pass
class
D
(
object
):
@
make_closure
def
__get__
(
self
,
obj
,
type
,
other_arg
=
2.4
**
10
):
...
...
@@ -125,14 +134,41 @@ def f():
print
c
.
x
f
()
f
()
f
()
# Deleting the descriptor object itself:
def
f
():
class
C
(
object
):
pass
class
D
(
object
):
def
__get__
(
self
,
obj
,
type
,
other_arg
=
2.4
**
10
):
print
"D.__get__"
print
other_arg
del
C
.
x
print
other_arg
sys
.
_clear_type_cache
()
print
other_arg
return
1
C
.
x
=
D
()
c
=
C
()
print
c
.
x
print
c
.
x
f
()
f
()
f
()
# TODO: lots of other cases that could/should get tested.
# Related:
@
make_closure
def
f
(
a1
=
2.0
**
10
,
a2
=
2.1
**
10
):
f
.
func_defaults
=
()
print
a1
,
a2
del
globals
()[
'f'
]
def
f
():
@
make_closure
def
g
(
a1
=
2.0
**
10
,
a2
=
2.1
**
10
):
f
.
func_defaults
=
()
print
a1
,
a2
del
globals
()[
'f'
]
g
()
f
()
f
()
f
()
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