[Python-checkins] peps: PEP 445: fix examples

victor.stinner python-checkins at python.org
Thu Jun 20 23:56:13 CEST 2013


http://hg.python.org/peps/rev/b9a3b02a551d
changeset:   4955:b9a3b02a551d
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Jun 20 23:55:57 2013 +0200
summary:
  PEP 445: fix examples

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


diff --git a/pep-0445.txt b/pep-0445.txt
--- a/pep-0445.txt
+++ b/pep-0445.txt
@@ -125,10 +125,10 @@
 
 Default allocators:
 
-* ``PYALLOC_PYMEM_RAW``, ``PYALLOC_PYMEM``: ``malloc()``,
+* ``PYMEM_DOMAIN_RAW``, ``PYMEM_DOMAIN_MEM``: ``malloc()``,
   ``realloc()``, ``free()`` (and *ctx* is NULL); call ``malloc(1)`` when
   requesting zero bytes
-* ``PYALLOC_PYOBJECT``: *pymalloc* allocator which fall backs on
+* ``PYMEM_DOMAIN_OBJ``: *pymalloc* allocator which fall backs on
   ``PyMem_Malloc()`` for allocations larger than 512 bytes
 * *pymalloc* arena allocator: ``mmap()``, ``munmap()`` (and *ctx* is
   NULL), or ``malloc()`` and ``free()`` if ``mmap()`` is not available
@@ -226,8 +226,8 @@
         alloc.realloc = my_realloc;
         alloc.free = my_free;
 
-        PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc);
-        PyMem_SetAllocator(PYALLOC_PYMEM, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
 
         arena.ctx = &arena_padding;
         arena.alloc = my_alloc_arena;
@@ -238,7 +238,7 @@
     }
 
 .. warning::
-   Remove the call ``PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc)`` if
+   Remove the call ``PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc)`` if
    the new allocator is not thread-safe.
 
 
@@ -280,15 +280,15 @@
         alloc.realloc = my_realloc;
         alloc.free = my_free;
 
-        PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc);
-        PyMem_SetAllocator(PYALLOC_PYMEM, &alloc);
-        PyMem_SetAllocator(PYALLOC_PYOBJECT, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);
 
         PyMem_SetupDebugHooks();
     }
 
 .. warning::
-   Remove the call ``PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc)`` if
+   Remove the call ``PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc)`` if
    the new allocator is not thread-safe.
 
 
@@ -344,22 +344,22 @@
         alloc.malloc = hook_malloc;
         alloc.realloc = hook_realloc;
         alloc.free = hook_free;
-        PyMem_GetAllocator(PYALLOC_PYMEM_RAW, &hook.raw);
-        PyMem_GetAllocator(PYALLOC_PYMEM, &hook.mem);
-        PyMem_GetAllocator(PYALLOC_PYOBJECT, &hook.obj);
+        PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &hook.raw);
+        PyMem_GetAllocator(PYMEM_DOMAIN_MEM, &hook.mem);
+        PyMem_GetAllocator(PYMEM_DOMAIN_OBJ, &hook.obj);
 
         alloc.ctx = &hook.raw;
-        PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
 
         alloc.ctx = &hook.mem;
-        PyMem_SetAllocator(PYALLOC_PYMEM, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
 
         alloc.ctx = &hook.obj;
-        PyMem_SetAllocator(PYALLOC_PYOBJECT, &alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);
     }
 
 .. warning::
-   Remove the call ``PyMem_SetAllocator(PYALLOC_PYMEM_RAW, &alloc)`` if
+   Remove the call ``PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc)`` if
    hooks are not thread-safe.
 
 .. note::

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


More information about the Python-checkins mailing list