Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
corona10 and vstinner authored Dec 13, 2025
commit 987cf09a1ff6ccad34c22e104a594e033b2e6793
4 changes: 2 additions & 2 deletions Doc/library/mmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ To map anonymous memory, -1 should be passed as the fileno along with the length

.. method:: set_name(name, /)

Annotate the memory map with the given *name* for easier identification
Annotate the memory mapping with the given *name* for easier identification
in ``/proc/<pid>/maps`` if the kernel supports the feature and :option:`-X dev <-X>` is passed
to Python or if Python is built in :ref:`debug mode <debug-build>`
Comment thread
corona10 marked this conversation as resolved.
Outdated
The length of *name* must not exceed 67 bytes.

.. availability:: Linux >= 5.17
.. availability:: Linux >= 5.17 (kernel built with `CONFIG_ANON_VMA_NAME` option)

.. versionadded:: next

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ mmap
(Contributed by Serhiy Storchaka in :gh:`78502`.)

* Added the :meth:`mmap.mmap.set_name` method
to annotate an anonymous memory map
to annotate an anonymous memory mapping
if Linux kernel supports :manpage:`PR_SET_VMA_ANON_NAME <PR_SET_VMA(2const)>` (Linux 5.17 or newer).
(Contributed by Donghee Na in :gh:`142419`.)

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_mmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,12 +1176,12 @@ def test_set_name(self):

# Test name length limit (80 chars including prefix "cpython:mmap:")
# Prefix is 13 chars, so max name is 67 chars
long_name = 'x' * 30
long_name = 'x' * 67
result = m.set_name(long_name)
self.assertIsNone(result)

# Test name too long
Comment thread
picnixz marked this conversation as resolved.
too_long_name = 'x' * 80
too_long_name = 'x' * 68
with self.assertRaises(ValueError):
m.set_name(too_long_name)

Expand Down
Loading