summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-05-02 20:31:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-05-02 20:31:14 (GMT)
commitdb067af12a5ebb889874e47d8177f9c4a3dc9a68 (patch)
tree87cea7c1fb4a0905ac2632c03520c43f377b3584 /Doc/whatsnew
parentd50c3f3f3af54f3be46d26d53a1c10b7c15a7b2d (diff)
downloadcpython-db067af12a5ebb889874e47d8177f9c4a3dc9a68.zip
cpython-db067af12a5ebb889874e47d8177f9c4a3dc9a68.tar.gz
cpython-db067af12a5ebb889874e47d8177f9c4a3dc9a68.tar.bz2
Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),
PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) and bytearray(int) are now using ``calloc()`` instead of ``malloc()`` for large objects which is faster and use less memory (until the bytearray buffer is filled with data).
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.5.rst20
1 files changed, 18 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
index 02ff833..fbbac03 100644
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -164,7 +164,10 @@ Optimizations
Major performance enhancements have been added:
-* None yet.
+* Construction of ``bytes(int)`` and ``bytearray(int)`` (filled by zero bytes)
+ is faster and use less memory (until the bytearray buffer is filled with
+ data) for large objects. ``calloc()`` is used instead of ``malloc()`` to
+ allocate memory for these objects.
Build and C API Changes
@@ -172,7 +175,12 @@ Build and C API Changes
Changes to Python's build process and to the C API include:
-* None yet.
+* New ``calloc`` functions:
+
+ * :c:func:`PyMem_RawCalloc`
+ * :c:func:`PyMem_Calloc`
+ * :c:func:`PyObject_Calloc`
+ * :c:func:`_PyObject_GC_Calloc`
Deprecated
@@ -209,6 +217,9 @@ Porting to Python 3.5
This section lists previously described changes and other bugfixes
that may require changes to your code.
+Changes in the Python API
+-------------------------
+
* Before Python 3.5, a :class:`datetime.time` object was considered to be false
if it represented midnight in UTC. This behavior was considered obscure and
error-prone and has been removed in Python 3.5. See :issue:`13936` for full
@@ -217,3 +228,8 @@ that may require changes to your code.
* :meth:`ssl.SSLSocket.send()` now raises either :exc:`ssl.SSLWantReadError`
or :exc:`ssl.SSLWantWriteError` on a non-blocking socket if the operation
would block. Previously, it would return 0. See :issue:`20951`.
+
+Changes in the C API
+--------------------
+
+* The :c:type:`PyMemAllocator` structure has a new ``calloc`` field.