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
c22574f0
Commit
c22574f0
authored
Aug 11, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix leaks in BoxedLong and BoxedThreadLock
parent
88f52b0b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/runtime/builtin_modules/thread.cpp
src/runtime/builtin_modules/thread.cpp
+3
-4
src/runtime/long.cpp
src/runtime/long.cpp
+1
-0
No files found.
src/runtime/builtin_modules/thread.cpp
View file @
c22574f0
...
...
@@ -161,7 +161,7 @@ public:
static
Box
*
exit
(
Box
*
_self
,
Box
*
arg1
,
Box
*
arg2
,
Box
**
args
)
{
return
release
(
_self
);
}
static
void
threadLockDestructor
(
Box
*
_self
)
{
static
void
dealloc
(
Box
*
_self
)
{
RELEASE_ASSERT
(
_self
->
cls
==
thread_lock_cls
,
""
);
BoxedThreadLock
*
self
=
static_cast
<
BoxedThreadLock
*>
(
_self
);
...
...
@@ -173,6 +173,8 @@ public:
PyThread_free_lock
(
self
->
lock_lock
);
self
->
lock_lock
=
NULL
;
}
_self
->
cls
->
tp_free
(
_self
);
}
static
Box
*
locked
(
Box
*
_self
)
{
...
...
@@ -185,8 +187,6 @@ public:
}
Py_RETURN_TRUE
;
}
static
void
dealloc
(
Box
*
b
)
noexcept
{
Py_FatalError
(
"unimplemented"
);
}
};
...
...
@@ -232,7 +232,6 @@ void setupThread() {
thread_lock_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
0
,
0
,
sizeof
(
BoxedThreadLock
),
false
,
"lock"
,
true
,
BoxedThreadLock
::
dealloc
,
NULL
,
false
);
thread_lock_cls
->
tp_dealloc
=
BoxedThreadLock
::
threadLockDestructor
;
thread_lock_cls
->
instances_are_nonzero
=
true
;
thread_lock_cls
->
giveAttr
(
"__module__"
,
boxString
(
"thread"
));
...
...
src/runtime/long.cpp
View file @
c22574f0
...
...
@@ -65,6 +65,7 @@ int _PyLong_DigitValue[256] = {
void
BoxedLong
::
tp_dealloc
(
Box
*
b
)
noexcept
{
mpz_clear
(
static_cast
<
BoxedLong
*>
(
b
)
->
n
);
b
->
cls
->
tp_free
(
b
);
}
extern
"C"
int
_PyLong_Sign
(
PyObject
*
l
)
noexcept
{
...
...
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