Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c2fc5683
Kaydet (Commit)
c2fc5683
authored
Mar 18, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Enhance documentation on malloc debug hooks
Issue #26564, #26516, #26563.
üst
3ca33423
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
memory.rst
Doc/c-api/memory.rst
+6
-3
cmdline.rst
Doc/using/cmdline.rst
+10
-6
3.6.rst
Doc/whatsnew/3.6.rst
+4
-2
No files found.
Doc/c-api/memory.rst
Dosyayı görüntüle @
c2fc5683
...
@@ -346,8 +346,9 @@ Customize Memory Allocators
...
@@ -346,8 +346,9 @@ Customize Memory Allocators
- Detect write before the start of the buffer (buffer underflow)
- Detect write before the start of the buffer (buffer underflow)
- Detect write after the end of the buffer (buffer overflow)
- Detect write after the end of the buffer (buffer overflow)
- Check that the :term:`GIL <global interpreter lock>` is held when
- Check that the :term:`GIL <global interpreter lock>` is held when
allocator functions of the :c:data:`PYMEM_DOMAIN_OBJ` domain (ex:
allocator functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex:
:c:func:`PyObject_Malloc`) are called
:c:func:`PyObject_Malloc`) and :c:data:`PYMEM_DOMAIN_MEM` (ex:
:c:func:`PyMem_Malloc`) domains are called
On error, the debug hooks use the :mod:`tracemalloc` module to get the
On error, the debug hooks use the :mod:`tracemalloc` module to get the
traceback where a memory block was allocated. The traceback is only
traceback where a memory block was allocated. The traceback is only
...
@@ -361,7 +362,9 @@ Customize Memory Allocators
...
@@ -361,7 +362,9 @@ Customize Memory Allocators
.. versionchanged:: 3.6
.. versionchanged:: 3.6
This function now also works on Python compiled in release mode.
This function now also works on Python compiled in release mode.
On error, the debug hooks now use :mod:`tracemalloc` to get the traceback
On error, the debug hooks now use :mod:`tracemalloc` to get the traceback
where a memory block was allocated.
where a memory block was allocated. The debug hooks now also check
if the GIL is hold when functions of :c:data:`PYMEM_DOMAIN_OBJ` and
:c:data:`PYMEM_DOMAIN_MEM` domains are called.
.. _pymalloc:
.. _pymalloc:
...
...
Doc/using/cmdline.rst
Dosyayı görüntüle @
c2fc5683
...
@@ -638,16 +638,20 @@ conflict.
...
@@ -638,16 +638,20 @@ conflict.
Install debug hooks:
Install debug hooks:
* ``debug``: install debug hooks on top of the default memory allocator
* ``debug``: install debug hooks on top of the default memory allocator
* ``malloc_debug``: same than ``malloc`` but also install debug hooks
* ``malloc_debug``: same as ``malloc`` but also install debug hooks
* ``pymalloc_debug``: same than ``malloc`` but also install debug hooks
* ``pymalloc_debug``: same as ``pyalloc`` but also install debug hooks
When is compiled in release mode, the default is ``pymalloc``. When Python
is compiled in debug mode, the default is ``pymalloc_debug``: debug hooks
are installed.
If Python is configured without ``pymalloc`` support, ``pymalloc`` and
``pymalloc_debug`` are not available, the default is ``malloc`` in release
mode and ``malloc_debug`` in debug mode.
See the :c:func:`PyMem_SetupDebugHooks` function for debug hooks on Python
See the :c:func:`PyMem_SetupDebugHooks` function for debug hooks on Python
memory allocators.
memory allocators.
.. note::
``pymalloc`` and ``pymalloc_debug`` are not available if Python is
configured without ``pymalloc`` support.
.. versionadded:: 3.6
.. versionadded:: 3.6
...
...
Doc/whatsnew/3.6.rst
Dosyayı görüntüle @
c2fc5683
...
@@ -118,8 +118,10 @@ compiled in release mode using ``PYTHONMALLOC=debug``. Effects of debug hooks:
...
@@ -118,8 +118,10 @@ compiled in release mode using ``PYTHONMALLOC=debug``. Effects of debug hooks:
* Detect write before the start of the buffer (buffer underflow)
* Detect write before the start of the buffer (buffer underflow)
* Detect write after the end of the buffer (buffer overflow)
* Detect write after the end of the buffer (buffer overflow)
* Check that the :term:`GIL <global interpreter lock>` is held when allocator
* Check that the :term:`GIL <global interpreter lock>` is held when allocator
functions of the :c:data:`PYMEM_DOMAIN_OBJ` domain (ex:
functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and
:c:func:`PyObject_Malloc`) are called
:c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called.
Checking if the GIL is hold is also a new feature of Python 3.6.
See the :c:func:`PyMem_SetupDebugHooks` function for debug hooks on Python
See the :c:func:`PyMem_SetupDebugHooks` function for debug hooks on Python
memory allocators.
memory allocators.
...
...
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