[Python-checkins] peps: PEP 445: explain why External Libraries and Memory Allocators sections are

victor.stinner python-checkins at python.org
Mon Jul 1 23:15:59 CEST 2013


http://hg.python.org/peps/rev/358aa763611a
changeset:   4971:358aa763611a
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Jul 01 23:15:45 2013 +0200
summary:
  PEP 445: explain why External Libraries and Memory Allocators sections are present

files:
  pep-0445.txt |  16 +++++++++++++---
  1 files changed, 13 insertions(+), 3 deletions(-)


diff --git a/pep-0445.txt b/pep-0445.txt
--- a/pep-0445.txt
+++ b/pep-0445.txt
@@ -639,9 +639,11 @@
 In C++, the context can be used to pass *this*.
 
 
-External libraries
+External Libraries
 ==================
 
+Examples of API used to customize memory allocators.
+
 Libraries used by Python:
 
 * OpenSSL: `CRYPTO_set_mem_functions()
@@ -672,11 +674,15 @@
   <http://docs.oracle.com/cd/B10501_01/appdev.920/a96584/oci15re4.htm>`_,
   pass an opaque pointer
 
+The new *ctx* parameter of this PEP was inspired by the API of zlib and
+Oracle's OCI libraries.
+
 See also the `GNU libc: Memory Allocation Hooks
-<http://www.gnu.org/software/libc/manual/html_node/Hooks-for-Malloc.html>`_.
+<http://www.gnu.org/software/libc/manual/html_node/Hooks-for-Malloc.html>`_
+which uses a different approach to hook memory allocators.
 
 
-Memory allocators
+Memory Allocators
 =================
 
 The C standard library provides the well known ``malloc()`` function.
@@ -727,6 +733,10 @@
   <https://developer.gnome.org/glib/unstable/glib-Memory-Slices.html>`_:
   efficient way to allocate groups of equal-sized chunks of memory
 
+This PEP permits to choose exactly which memory allocator is used for your
+application depending on its usage of the memory (number of allocation, size of
+allocations, lifetime of objects, etc.).
+
 
 Links
 =====

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list