# HG changeset patch # User Joshua Jay Herman # Date 1465156453 18000 # Sun Jun 05 14:54:13 2016 -0500 # Node ID 402971acb455619efc7d5b21969749e180820375 # Parent 76edf8f9bbdb8159433eb9bc0c327747be6458fd Rewrote man page from code review by berker.peksag. diff -r 76edf8f9bbdb -r 402971acb455 Misc/python.man --- a/Misc/python.man Fri Jun 03 16:12:05 2016 -0500 +++ b/Misc/python.man Sun Jun 05 14:54:13 2016 -0500 @@ -432,43 +432,26 @@ the value 0 will disable hash randomization. .IP PYTHONMALLOC Set the Python memory allocators and/or install debug hooks. - -Set the family of memory allocators used by Python: - -* "malloc": use the malloc() function of the C library - for all domains ("PYMEM_DOMAIN_RAW", "PYMEM_DOMAIN_MEM", - "PYMEM_DOMAIN_OBJ"). - -* "pymalloc": use the "pymalloc allocator " for - "PYMEM_DOMAIN_MEM" and "PYMEM_DOMAIN_OBJ" domains and use - the "malloc" function for the "PYMEM_DOMAIN_RAW" domain. +These are theavailable memory allocators are "malloc" and "pymalloc". +These are the available debug hooks are "debug","malloc_debug", +and "pymalloc_debug". -Install debug hooks: - -* "debug": install debug hooks on top of the default memory allocator - -* "malloc_debug": same as "malloc" but also install debug hooks - -* "pymalloc_debug": same as "pymalloc" but also install debug hooks - -When Python is compiled in release mode, the default is "pymalloc". When -compiled in debug mode, the default is "pymalloc_debug" and the debug hooks -are used automatically. +When Python is compiled in release mode, the default is "pymalloc". +When compiled in debug mode, the default is "pymalloc_debug" and +the debug hooks are used automatically. 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 "PyMem_SetupDebugHooks" function for debug hooks on Python -memory allocators. .IP PYTHONMALLOCSTATS If set to a non-empty string, Python will print statistics of the pymalloc memory allocator every time a new pymalloc object arena is created, and on shutdown. This variable is ignored if the PYTHONMALLOC environment variable -is used to force the "malloc()" allocator of the C library, or if -Python is configured without pymalloc support. +$PYTHONMALLOC is used to force the "malloc()" allocator +of the C library, or if Python is configured without pymalloc support. .IP PYTHONASYNCIODEBUG If this environment variable is set to a non-empty string, enable the debug mode of the asyncio module. @@ -476,8 +459,9 @@ If this environment variable is set to a non-empty string, start tracing Python memory allocations using the tracemalloc module. The value of the variable is the maximum number of frames -stored in a traceback of a trace. For example, "PYTHONTRACEMALLOC=1" -stores only the most recent frame. See the +stored in a traceback of a trace. For example, +.IB PYTHONTRACEMALLOC=1 +stores only the most recent frame. See the documentation .IR tracemalloc.start() for more information. .IP PYTHONFAULTHANDLER @@ -485,17 +469,25 @@ .IR faulthandler.enable() is called at startup: install a handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals to -dump the Python traceback. This is equivalent to -X "faulthandler" option. +dump the Python traceback. + +This is equivalent to the -X "faulthandler" option. .IP PYTHONEXECUTABLE -If this environment variable is set, "sys.argv[0]" will be set to its value instead of the value got through the C runtime. Only works on Mac OS X. +If this environment variable is set, +.IB sys.argv[0] +will be set to its value instead of the value got through +the C runtime. Only works on Mac OS X. .SH DEBUG-MODE VARIABLES -Setting these variables only has an effect in a debug build of Python, that is, if Python was configured with the --with-pydebug build option. +Setting these variables only has an effect in a debug build +of Python, that is, if Python was configured with the +\fB\--with-pydebug\fP build option. .IP PYTHONTHREADDEBUG If set, Python will print threading debug info. .IP PYTHONDUMPREFS -If set, Python will dump objects and reference counts still alive after shutting down the interpreter. +If set, Python will dump objects and reference counts still +alive after shutting down the interpreter. .SH AUTHOR The Python Software Foundation: https://www.python.org/psf/