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
ce5179fc
Commit
ce5179fc
authored
Jan 31, 2016
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23601: Use small object allocator for dict key objects
parent
89e54338
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Misc/NEWS
Misc/NEWS
+3
-0
Objects/dictobject.c
Objects/dictobject.c
+3
-3
No files found.
Misc/NEWS
View file @
ce5179fc
...
...
@@ -18,6 +18,9 @@ Core and Builtins
by external AST optimizers, but the compiler does not emit directly such
node.
- Issue #23601: Sped-up allocation of dict key objects by using Python'
s
small
object
allocator
.
(
Contributed
by
Julian
Taylor
.)
-
Issue
#
18018
:
Import
raises
ImportError
instead
of
SystemError
if
a
relative
import
is
attempted
without
a
known
parent
package
.
...
...
Objects/dictobject.c
View file @
ce5179fc
...
...
@@ -324,7 +324,7 @@ static PyDictKeysObject *new_keys_object(Py_ssize_t size)
assert
(
size
>=
PyDict_MINSIZE_SPLIT
);
assert
(
IS_POWER_OF_2
(
size
));
dk
=
Py
Mem
_MALLOC
(
sizeof
(
PyDictKeysObject
)
+
dk
=
Py
Object
_MALLOC
(
sizeof
(
PyDictKeysObject
)
+
sizeof
(
PyDictKeyEntry
)
*
(
size
-
1
));
if
(
dk
==
NULL
)
{
PyErr_NoMemory
();
...
...
@@ -353,7 +353,7 @@ free_keys_object(PyDictKeysObject *keys)
Py_XDECREF
(
entries
[
i
].
me_key
);
Py_XDECREF
(
entries
[
i
].
me_value
);
}
Py
Mem
_FREE
(
keys
);
Py
Object
_FREE
(
keys
);
}
#define new_values(size) PyMem_NEW(PyObject *, size)
...
...
@@ -964,7 +964,7 @@ dictresize(PyDictObject *mp, Py_ssize_t minused)
}
}
assert
(
oldkeys
->
dk_refcnt
==
1
);
DK_DEBUG_DECREF
Py
Mem
_FREE
(
oldkeys
);
DK_DEBUG_DECREF
Py
Object
_FREE
(
oldkeys
);
}
return
0
;
}
...
...
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