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
3c174ca0
Commit
3c174ca0
authored
Aug 08, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move obmalloc item into C API section
parent
b9346c33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
Doc/whatsnew/whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+29
-29
No files found.
Doc/whatsnew/whatsnew25.tex
View file @
3c174ca0
...
...
@@ -2219,8 +2219,8 @@ which modifies the interpreter to use a \ctype{Py_ssize_t} type
definition instead of
\ctype
{
int
}
. See the earlier
section~
\ref
{
pep-353
}
for a discussion of this change.
\item
The design of the bytecode compiler has changed a great deal,
to
no longer generat
e
bytecode by traversing the parse tree. Instead
\item
The design of the bytecode compiler has changed a great deal,
no longer generat
ing
bytecode by traversing the parse tree. Instead
the parse tree is converted to an abstract syntax tree (or AST), and it is
the abstract syntax tree that's traversed to produce the bytecode.
...
...
@@ -2261,6 +2261,32 @@ Grant Edwards, John Ehresman, Kurt Kaiser, Neal Norwitz, Tim Peters,
Armin Rigo, and Neil Schemenauer, plus the participants in a number of
AST sprints at conferences such as PyCon.
\item
Evan Jones's patch to obmalloc, first described in a talk
at PyCon DC 2005, was applied. Python 2.4 allocated small objects in
256K-sized arenas, but never freed arenas. With this patch, Python
will free arenas when they're empty. The net effect is that on some
platforms, when you allocate many objects, Python's memory usage may
actually drop when you delete them and the memory may be returned to
the operating system. (Implemented by Evan Jones, and reworked by Tim
Peters.)
Note that this change means extension modules must be more careful
when allocating memory. Python's API has many different
functions for allocating memory that are grouped into families. For
example,
\cfunction
{
PyMem
_
Malloc()
}
,
\cfunction
{
PyMem
_
Realloc()
}
, and
\cfunction
{
PyMem
_
Free()
}
are one family that allocates raw memory,
while
\cfunction
{
PyObject
_
Malloc()
}
,
\cfunction
{
PyObject
_
Realloc()
}
,
and
\cfunction
{
PyObject
_
Free()
}
are another family that's supposed to
be used for creating Python objects.
Previously these different families all reduced to the platform's
\cfunction
{
malloc()
}
and
\cfunction
{
free()
}
functions. This meant
it didn't matter if you got things wrong and allocated memory with the
\cfunction
{
PyMem
}
function but freed it with the
\cfunction
{
PyObject
}
function. With 2.5's changes to obmalloc, these families now do different
things and mismatches will probably result in a segfault. You should
carefully test your C extension modules with Python 2.5.
\item
The built-in set types now have an official C API. Call
\cfunction
{
PySet
_
New()
}
and
\cfunction
{
PyFrozenSet
_
New()
}
to create a
new set,
\cfunction
{
PySet
_
Add()
}
and
\cfunction
{
PySet
_
Discard()
}
to
...
...
@@ -2347,32 +2373,6 @@ Some of the more notable changes are:
\begin{itemize}
\item
Evan Jones's patch to obmalloc, first described in a talk
at PyCon DC 2005, was applied. Python 2.4 allocated small objects in
256K-sized arenas, but never freed arenas. With this patch, Python
will free arenas when they're empty. The net effect is that on some
platforms, when you allocate many objects, Python's memory usage may
actually drop when you delete them, and the memory may be returned to
the operating system. (Implemented by Evan Jones, and reworked by Tim
Peters.)
Note that this change means extension modules need to be more careful
with how they allocate memory. Python's API has many different
functions for allocating memory that are grouped into families. For
example,
\cfunction
{
PyMem
_
Malloc()
}
,
\cfunction
{
PyMem
_
Realloc()
}
, and
\cfunction
{
PyMem
_
Free()
}
are one family that allocates raw memory,
while
\cfunction
{
PyObject
_
Malloc()
}
,
\cfunction
{
PyObject
_
Realloc()
}
,
and
\cfunction
{
PyObject
_
Free()
}
are another family that's supposed to
be used for creating Python objects.
Previously these different families all reduced to the platform's
\cfunction
{
malloc()
}
and
\cfunction
{
free()
}
functions. This meant
it didn't matter if you got things wrong and allocated memory with the
\cfunction
{
PyMem
}
function but freed it with the
\cfunction
{
PyObject
}
function. With the obmalloc change, these families now do different
things, and mismatches will probably result in a segfault. You should
carefully test your C extension modules with Python 2.5.
\item
Coverity, a company that markets a source code analysis tool
called Prevent, provided the results of their examination of the Python
source code. The analysis found about 60 bugs that
...
...
@@ -2444,7 +2444,7 @@ suggestions, corrections and assistance with various drafts of this
article: Nick Coghlan, Phillip J. Eby, Lars Gust
\"
abel, Raymond Hettinger, Ralf
W. Grosse-Kunstleve, Kent Johnson, Martin von~L
\"
owis, Fredrik Lundh,
Andrew McNamara, Skip Montanaro,
Gustavo Niemeyer, James Pryor, Mike Rovner, Scott Weikart, Barry
Gustavo Niemeyer,
Paul Prescod,
James Pryor, Mike Rovner, Scott Weikart, Barry
Warsaw, Thomas Wouters.
\end{document}
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