FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-141004: Document `Py_LOCAL` and `Py_LOCAL_INLINE` (GH-141725) by miss-islington · Pull Request #141761 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 11 additions & 0 deletions Doc/c-api/intro.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ complete listing.
Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the
command line (see :c:member:`PyConfig.use_environment`).

.. c:macro:: Py_LOCAL(type)

Declare a function returning the specified *type* using a fast-calling
qualifier for functions that are local to the current file.
Semantically, this is equivalent to ``static type``.

.. c:macro:: Py_LOCAL_INLINE(type)

Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function
be inlined.

.. c:macro:: Py_MAX(x, y)

Return the maximum value between ``x`` and ``y``.
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/2.5.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2169,9 +2169,9 @@ Changes to Python's build process and to the C API include:

* Two new macros can be used to indicate C functions that are local to the
current file so that a faster calling convention can be used.
``Py_LOCAL(type)`` declares the function as returning a value of the
:c:macro:`Py_LOCAL` declares the function as returning a value of the
specified *type* and uses a fast-calling qualifier.
``Py_LOCAL_INLINE(type)`` does the same thing and also requests the
:c:macro:`Py_LOCAL_INLINE` does the same thing and also requests the
function be inlined. If macro :c:macro:`!PY_LOCAL_AGGRESSIVE` is defined before
:file:`python.h` is included, a set of more aggressive optimizations are enabled
for the module; you should benchmark the results to find out if these
Expand Down
Loading

Back | FazBrowse Home | New Git URL