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
0b752287
Commit
0b752287
authored
Jul 06, 2018
by
Yury Selivanov
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34042: Fix dict.copy() to maintain correct total refcount (GH-8119)
parent
dc9bc548
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
Misc/NEWS.d/next/Core and Builtins/2018-07-05-15-51-29.bpo-34042.Gr9XUH.rst
...ore and Builtins/2018-07-05-15-51-29.bpo-34042.Gr9XUH.rst
+2
-0
Objects/dictobject.c
Objects/dictobject.c
+7
-0
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-07-05-15-51-29.bpo-34042.Gr9XUH.rst
0 → 100644
View file @
0b752287
Fix dict.copy() to maintain correct total refcount (as reported by
sys.gettotalrefcount()).
Objects/dictobject.c
View file @
0b752287
...
...
@@ -656,6 +656,13 @@ clone_combined_dict(PyDictObject *orig)
/* Maintain tracking. */
_PyObject_GC_TRACK
(
new
);
}
/* Since we copied the keys table we now have an extra reference
in the system. Manually call _Py_INC_REFTOTAL to signal that
we have it now; calling DK_INCREF would be an error as
keys->dk_refcnt is already set to 1 (after memcpy). */
_Py_INC_REFTOTAL
;
return
(
PyObject
*
)
new
;
}
...
...
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