summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/memory.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] C-API docs: Clarify the size of arenas (GH-110895) (#110947)Miss Islington (bot)2023-10-161-1/+2
| | | | | | | | | | | C-API docs: Clarify the size of arenas (GH-110895) Clarify the size of arenas From 3.10.0 alpha 7, the pymalloc allocator uses arenas with a fixed size of 1 MiB on 64-bit platforms instead of 256 KiB on 32-bit platforms. (cherry picked from commit f07ca27709855d4637b43bba23384cc795143ee3) Co-authored-by: Mienxiu <82512658+mienxiu@users.noreply.github.com>
* [3.11] gh-110631: Fix reST indentation (GH-110724) (#110739)Ezio Melotti2023-10-111-12/+12
| | | | | | * Fix wrong indentation in the other dirs. * Fix more wrong indentation.. (cherry picked from commit 718391f475f2550d99dd794069ca76312f7f6aa6)
* [3.11] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) ↵Serhiy Storchaka2023-07-281-0/+2
| | | | | (GH-107381) (cherry picked from commit 983305268e2291b0a7835621b81bf40cba7c27f3)
* [3.11] gh-107298: Fix more Sphinx warnings in the C API doc (GH-107329) ↵Serhiy Storchaka2023-07-281-8/+8
| | | | | | | | | | | | | | | | | | | (GH-107377) Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() (cherry picked from commit 8d61a71f9c81619e34d4a30b625922ebc83c561b) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.11] gh-106948: Add standard external names to nitpick_ignore (GH-106949) ↵Serhiy Storchaka2023-07-231-1/+1
| | | | | | | (#107061) It includes standard C types, macros and variables like "size_t", "LONG_MAX" and "errno", and standard environment variables like "PATH".. (cherry picked from commit f8b7fe2f2647813ae8249675a80e59c117d30fe1)
* [3.11] gh-106919: Use role :c:macro: for referencing the C "constants" ↵Serhiy Storchaka2023-07-211-9/+9
| | | | | (GH-106920) (GH-106952) (cherry picked from commit fcc816dbff7ca66c26f57a506e4d2330fe41d0ff)
* gh-96997: Clarify the contract of PyMem_SetAllocator() (GH-98977)Miss Islington (bot)2022-11-021-0/+21
| | | | | (cherry picked from commit c053284e3930027847d5adf99efcb1aa5ccbacd1) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C ↵Łukasz Langa2022-10-051-6/+6
| | | | | | | | | | type>) (GH-97768) (#97924) :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 0031e62973801d34a9e19ab7bb199e9668e32d7b) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-93738: Documentation C syntax (:c:type:`TYPE` -> :c:expr:`TYPE`) ↵Miss Islington (bot)2022-10-051-2/+2
| | | | | | | | (GH-97770) (#97874) :c:type:`TYPE` -> :c:expr:`TYPE` (cherry picked from commit 8b211b4cdbcddecfcc4d1682864795b5f1438c59) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Docs: remove redundant "adverb-adjective" hyphens from compound modifiers ↵Miss Islington (bot)2022-07-051-1/+1
| | | | | | | | (GH-94551) (GH-94557) Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021 (cherry picked from commit 3440d197a55800ecceea3e115e44b4262411359c) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* c-api docs: There are five fields, not four (GH-32379)Jelle Zijlstra2022-04-071-1/+1
|
* More minor fixes to C API docs (GH-31525)Jelle Zijlstra2022-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * wording fixes in type.rst * grammar and punctuation in sys.rst * set: grammar fixes * structures: capitalization fix * grammar fixes for sequence * objects: point to Py_TYPE instead of direct object access * numbers: add more explicit Python equivalences * method: add missing period * memory: grammar fix * mapping: grammar fixes * long: grammar fix * iter: fix grammar for PyAIter_Check * init: grammar fix
* Fix a small typo in the docs (GH-26991)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2021-07-031-1/+1
|
* bpo-44113: Deprecate old functions to config Python init (GH-26060)Victor Stinner2021-05-121-0/+2
| | | | | | | | | | | | | | | | | Deprecate the following functions to configure the Python initialization: * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() * PySys_HasWarnOptions() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587).
* bpo-43928: Fix 'succesfully' typo in document (GH-25569)JT2021-04-301-1/+1
|
* bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)Victor Stinner2021-04-291-38/+111
| | | Enhance also the documentation of debug hooks on memory allocators.
* bpo-43774: Document configure options (GH-25283)Victor Stinner2021-04-081-6/+7
| | | | | | Add Doc/using/configure.rst documentation to document configure, preprocessor, compiler and linker options. Add a new section about the "Python debug build".
* bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795)Victor Stinner2021-03-091-1/+1
|
* Fix Sphynx syntax in the memory.rst documentv3.10.0a5Pablo Galindo2021-02-021-1/+1
|
* Add a clarification for the object-domain allocators regarding pointer ↵Pablo Galindo2021-01-191-0/+7
| | | | validity (GH-24253)
* Add a paragraph about allocation domains to the C-API docs (GH-24252)Pablo Galindo2021-01-181-1/+32
|
* bpo-40204, doc: Fix syntax of C variables (GH-21846)Victor Stinner2020-08-131-13/+13
| | | | | | | | | | | | | | | For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3.
* fix(doc): set correct RST syntax for c:function (GH-18589)Julien Danjou2020-02-211-2/+2
| | | The current content is not rendered since the syntax is not correct.
* bpo-38600: NULL -> ``NULL``. (GH-17001)Serhiy Storchaka2019-10-301-1/+1
| | | Also fix some other formatting.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-28/+28
| | | | Replace all *NULL* with ``NULL``.
* Remove trailing .0 from version changed note (GH-14987)Nick Coghlan2019-07-281-1/+1
|
* closes bpo-37508: Fix name of type in memory.rst. (GH-14604)Hai Shi2019-07-061-1/+1
|
* Doc: Replace the deprecated highlightlang directive by highlight. (#13377)Stéphane Wirtel2019-05-171-1/+1
| | | | highlightlang is deprecated since April 2018 in Sphinx. See https://github.com/sphinx-doc/sphinx/pull/4845
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)Victor Stinner2019-04-111-2/+9
| | | | | Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free().
* Fix typo in Memory Management doc. (GH-10798)Kevin Adler2018-11-301-1/+1
|
* bpo-33892: Doc: Use gender neutral words (GH-7770)Andrés Delfino2018-06-181-1/+1
|
* Make formatting of some return codes conforming to the general style. (#5587)Serhiy Storchaka2018-02-091-1/+1
|
* bpo-32030: Rework memory allocators (#4625)Victor Stinner2017-11-291-9/+38
| | | | | | | | | | | | | | | | | | | | * Fix _PyMem_SetupAllocators("debug"): always restore allocators to the defaults, rather than only caling _PyMem_SetupDebugHooks(). * Add _PyMem_SetDefaultAllocator() helper to set the "default" allocator. * Add _PyMem_GetAllocatorsName(): get the name of the allocators * main() now uses debug hooks on memory allocators if Py_DEBUG is defined, rather than calling directly malloc() * Document default memory allocators in C API documentation * _Py_InitializeCore() now fails with a fatal user error if PYTHONMALLOC value is an unknown memory allocator, instead of failing with a fatal internal error. * Add new tests on the PYTHONMALLOC environment variable * Add support.with_pymalloc() * Add the _testcapi.WITH_PYMALLOC constant and expose it as support.with_pymalloc(). * sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so replace it with support.with_pymalloc(). * pythoninfo: add _testcapi collector for pymem
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-20064: Document PyObject_Malloc() (#4199)Victor Stinner2017-10-311-1/+64
| | | | | | | | | | Document the following functions: * PyObject_Malloc() * PyObject_Calloc() * PyObject_Realloc() * PyObject_Free() Fix also PyMem_RawFree() documentation.
* bpo-30054: Expose tracemalloc C API (#1236)Victor Stinner2017-06-201-0/+22
| | | | | | | | | * Make PyTraceMalloc_Track() and PyTraceMalloc_Untrack() functions public (remove the "_" prefix) * Remove the _PyTraceMalloc_domain_t type: use directly unsigned int. * Document methods Note: methods are already tested in test_tracemalloc.
* fix minor bug in pymalloc. (#335)INADA Naoki2017-02-271-1/+1
| | | reported by Alexis Lopez-Garcia.
* PyMem_Malloc() now uses the fast pymalloc allocatorVictor Stinner2016-04-221-23/+37
| | | | | | | Issue #26249: PyMem_Malloc() allocator family now uses the pymalloc allocator rather than system malloc(). Applications calling PyMem_Malloc() without holding the GIL can now crash: use PYTHONMALLOC=debug environment variable to validate the usage of memory allocators in your application.
* Fix typo in doc: avoid the french "& cie" :-)Victor Stinner2016-03-231-1/+1
|
* Doc: fix typos, patch written by Stefan BehnelVictor Stinner2016-03-181-1/+1
|
* Enhance documentation on malloc debug hooksVictor Stinner2016-03-181-3/+6
| | | | Issue #26564, #26516, #26563.
* On memory error, dump the memory block tracebackVictor Stinner2016-03-151-0/+7
| | | | | | Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a memory block was allocated on memory block. Use the tracemalloc module to get the traceback.
* Check the GIL in PyObject_Malloc()Victor Stinner2016-03-141-3/+6
| | | | | Issue #26558: The debug hook of PyObject_Malloc() now checks that the GIL is held when the function is called.
* Add PYTHONMALLOC env varVictor Stinner2016-03-141-12/+26
| | | | | | | | | | | | | Issue #26516: * Add PYTHONMALLOC environment variable to set the Python memory allocators and/or install debug hooks. * PyMem_SetupDebugHooks() can now also be used on Python compiled in release mode. * The PYTHONMALLOCSTATS environment variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string. * In debug mode, debug hooks are now also installed on Python memory allocators when Python is configured without pymalloc.
* Issue #26516: Enhance Python mem allocators docVictor Stinner2016-03-091-43/+77
| | | | | | | * add link to PYTHONMALLOCSTATS env var * add parameters to PyMem macros like PyMem_MALLOC() * fix PyMem_SetupDebugHooks(): add Calloc functions * add some newlines for readability
* Merge: #23957: fix typo.R David Murray2015-04-141-1/+1
|\
| * #23957: fix typo.R David Murray2015-04-141-1/+1
| |
* | Issue #21233: Rename the C structure "PyMemAllocator" to "PyMemAllocatorEx" toVictor Stinner2014-06-021-4/+6
| | | | | | | | | | make sure that the code using it will be adapted for the new "calloc" field (instead of crashing).
* | Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),Victor Stinner2014-05-021-4/+32
|/ | | | | | 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).
* Issue #18874: _PyObject_Malloc/Realloc/Free() now falls back onVictor Stinner2013-10-101-2/+2
| | | | | | _PyMem_RawMalloc/Realloc/Free, instead of _PyMem_Malloc/Realloc/Free. So it becomes possible to use the fast pymalloc allocator for the PYMEM_DOMAIN_MEM domain (PyMem_Malloc/Realloc/Free functions).