Skip to content

Commit 987cf09

Browse files
corona10vstinner
andauthored
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent ca4bcec commit 987cf09

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Doc/library/mmap.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
330330

331331
.. method:: set_name(name, /)
332332

333-
Annotate the memory map with the given *name* for easier identification
333+
Annotate the memory mapping with the given *name* for easier identification
334334
in ``/proc/<pid>/maps`` if the kernel supports the feature and :option:`-X dev <-X>` is passed
335335
to Python or if Python is built in :ref:`debug mode <debug-build>`
336336
The length of *name* must not exceed 67 bytes.
337337

338-
.. availability:: Linux >= 5.17
338+
.. availability:: Linux >= 5.17 (kernel built with `CONFIG_ANON_VMA_NAME` option)
339339

340340
.. versionadded:: next
341341

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ mmap
582582
(Contributed by Serhiy Storchaka in :gh:`78502`.)
583583

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

Lib/test/test_mmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,12 +1176,12 @@ def test_set_name(self):
11761176

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

11831183
# Test name too long
1184-
too_long_name = 'x' * 80
1184+
too_long_name = 'x' * 68
11851185
with self.assertRaises(ValueError):
11861186
m.set_name(too_long_name)
11871187

0 commit comments

Comments
 (0)