Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Kirill Smelkov
cpython
Commits
f589c059
Commit
f589c059
authored
Mar 29, 2002
by
Neil Schemenauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If the GC is enabled then don't use the ob_type pointer to create a list
of trash objects. Use the gc_prev pointer instead.
parent
b883310d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Objects/object.c
Objects/object.c
+12
-1
No files found.
Objects/object.c
View file @
f589c059
...
...
@@ -2037,6 +2037,7 @@ PyObject * _PyTrash_delete_later = NULL;
void
_PyTrash_deposit_object
(
PyObject
*
op
)
{
#ifndef WITH_CYCLE_GC
int
typecode
;
if
(
PyTuple_Check
(
op
))
...
...
@@ -2054,8 +2055,11 @@ _PyTrash_deposit_object(PyObject *op)
return
;
/* pacify compiler -- execution never here */
}
op
->
ob_refcnt
=
typecode
;
op
->
ob_type
=
(
PyTypeObject
*
)
_PyTrash_delete_later
;
#else
assert
(
_Py_AS_GC
(
op
)
->
gc
.
gc_next
==
NULL
);
_Py_AS_GC
(
op
)
->
gc
.
gc_prev
=
(
PyGC_Head
*
)
_PyTrash_delete_later
;
#endif
_PyTrash_delete_later
=
op
;
}
...
...
@@ -2064,6 +2068,8 @@ _PyTrash_destroy_chain(void)
{
while
(
_PyTrash_delete_later
)
{
PyObject
*
shredder
=
_PyTrash_delete_later
;
#ifndef WITH_CYCLE_GC
_PyTrash_delete_later
=
(
PyObject
*
)
shredder
->
ob_type
;
switch
(
shredder
->
ob_refcnt
)
{
...
...
@@ -2083,6 +2089,11 @@ _PyTrash_destroy_chain(void)
shredder
->
ob_type
=
&
PyTraceBack_Type
;
break
;
}
#else
_PyTrash_delete_later
=
(
PyObject
*
)
_Py_AS_GC
(
shredder
)
->
gc
.
gc_prev
;
#endif
_Py_NewReference
(
shredder
);
++
_PyTrash_delete_nesting
;
...
...
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