Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-100479-add-makepath
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Apr 12, 2023
2 parents 117fe4b + 52f96d3 commit e75dedc
Show file tree
Hide file tree
Showing 104 changed files with 8,044 additions and 3,076 deletions.
4 changes: 3 additions & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@
# Minimum version of sphinx required
needs_sphinx = '3.2'

# Ignore any .rst files in the includes/ directory;
# they're embedded in pages but not rendered individually.
# Ignore any .rst files in the venv/ directory.
exclude_patterns = ['venv/*', 'README.rst']
exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst']
venvdir = os.getenv('VENVDIR')
if venvdir is not None:
exclude_patterns.append(venvdir + '/*')
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Glossary
A callable is an object that can be called, possibly with a set
of arguments (see :term:`argument`), with the following syntax::

callable(argument1, argument2, ...)
callable(argument1, argument2, argumentN)

A :term:`function`, and by extension a :term:`method`, is a callable.
An instance of a class that implements the :meth:`~object.__call__`
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ are always available. They are listed here in alphabetical order.

class C:
@staticmethod
def f(arg1, arg2, ...): ...
def f(arg1, arg2, argN): ...

The ``@staticmethod`` form is a function :term:`decorator` -- see
:ref:`function` for details.
Expand Down
17 changes: 11 additions & 6 deletions Doc/library/gc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,17 @@ The :mod:`gc` module provides the following functions:

.. function:: freeze()

Freeze all the objects tracked by gc - move them to a permanent generation
and ignore all the future collections. This can be used before a POSIX
fork() call to make the gc copy-on-write friendly or to speed up collection.
Also collection before a POSIX fork() call may free pages for future
allocation which can cause copy-on-write too so it's advised to disable gc
in parent process and freeze before fork and enable gc in child process.
Freeze all the objects tracked by the garbage collector; move them to a
permanent generation and ignore them in all the future collections.

If a process will ``fork()`` without ``exec()``, avoiding unnecessary
copy-on-write in child processes will maximize memory sharing and reduce
overall memory usage. This requires both avoiding creation of freed "holes"
in memory pages in the parent process and ensuring that GC collections in
child processes won't touch the ``gc_refs`` counter of long-lived objects
originating in the parent process. To accomplish both, call ``gc.disable()``
early in the parent process, ``gc.freeze()`` right before ``fork()``, and
``gc.enable()`` early in child processes.

.. versionadded:: 3.7

Expand Down
Loading

0 comments on commit e75dedc

Please sign in to comment.