mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Add PYTHONMALLOC env var
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.
This commit is contained in:
parent
c877658d1f
commit
34be807ca4
13 changed files with 383 additions and 90 deletions
|
|
@ -16,8 +16,17 @@ PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
|
|||
PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
|
||||
PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
|
||||
PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
|
||||
|
||||
/* Configure the Python memory allocators. Pass NULL to use default
|
||||
allocators. */
|
||||
PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt);
|
||||
|
||||
#ifdef WITH_PYMALLOC
|
||||
PyAPI_FUNC(int) _PyMem_PymallocEnabled(void);
|
||||
#endif
|
||||
|
||||
#endif /* !Py_LIMITED_API */
|
||||
|
||||
|
||||
/* BEWARE:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue