Skip to content

Commit e75dedc

Browse files
authored
Merge branch 'main' into pythongh-100479-add-makepath
2 parents 117fe4b + 52f96d3 commit e75dedc

File tree

104 files changed

+8044
-3076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+8044
-3076
lines changed

Doc/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@
6868
# Minimum version of sphinx required
6969
needs_sphinx = '3.2'
7070

71+
# Ignore any .rst files in the includes/ directory;
72+
# they're embedded in pages but not rendered individually.
7173
# Ignore any .rst files in the venv/ directory.
72-
exclude_patterns = ['venv/*', 'README.rst']
74+
exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst']
7375
venvdir = os.getenv('VENVDIR')
7476
if venvdir is not None:
7577
exclude_patterns.append(venvdir + '/*')

Doc/glossary.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Glossary
214214
A callable is an object that can be called, possibly with a set
215215
of arguments (see :term:`argument`), with the following syntax::
216216

217-
callable(argument1, argument2, ...)
217+
callable(argument1, argument2, argumentN)
218218

219219
A :term:`function`, and by extension a :term:`method`, is a callable.
220220
An instance of a class that implements the :meth:`~object.__call__`

Doc/library/functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ are always available. They are listed here in alphabetical order.
16811681

16821682
class C:
16831683
@staticmethod
1684-
def f(arg1, arg2, ...): ...
1684+
def f(arg1, arg2, argN): ...
16851685

16861686
The ``@staticmethod`` form is a function :term:`decorator` -- see
16871687
:ref:`function` for details.

Doc/library/gc.rst

+11-6
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,17 @@ The :mod:`gc` module provides the following functions:
206206

207207
.. function:: freeze()
208208

209-
Freeze all the objects tracked by gc - move them to a permanent generation
210-
and ignore all the future collections. This can be used before a POSIX
211-
fork() call to make the gc copy-on-write friendly or to speed up collection.
212-
Also collection before a POSIX fork() call may free pages for future
213-
allocation which can cause copy-on-write too so it's advised to disable gc
214-
in parent process and freeze before fork and enable gc in child process.
209+
Freeze all the objects tracked by the garbage collector; move them to a
210+
permanent generation and ignore them in all the future collections.
211+
212+
If a process will ``fork()`` without ``exec()``, avoiding unnecessary
213+
copy-on-write in child processes will maximize memory sharing and reduce
214+
overall memory usage. This requires both avoiding creation of freed "holes"
215+
in memory pages in the parent process and ensuring that GC collections in
216+
child processes won't touch the ``gc_refs`` counter of long-lived objects
217+
originating in the parent process. To accomplish both, call ``gc.disable()``
218+
early in the parent process, ``gc.freeze()`` right before ``fork()``, and
219+
``gc.enable()`` early in child processes.
215220

216221
.. versionadded:: 3.7
217222

0 commit comments

Comments
 (0)