Skip to content

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Dec 9, 2025

@corona10 corona10 requested a review from encukou December 10, 2025 00:09
@corona10
Copy link
Member Author

@picnixz @vstinner PTAL :)

@corona10 corona10 requested a review from picnixz December 11, 2025 01:23
@corona10 corona10 requested review from picnixz and vstinner December 11, 2025 19:29
@corona10 corona10 requested a review from vstinner December 13, 2025 09:53
@vstinner
Copy link
Member

@picnixz: What do you think of not adding cpython:mmap: prefix? set_name("abc") would sets the memory mapping name to [abc].

@picnixz
Copy link
Member

picnixz commented Dec 13, 2025

Personally, I think we should at least indicate cpython. As I don't have a kernel recent enough, I can't test this, but I guess that seeing "cpython" could help users grepping for whatever is related to cpython. I don't think we really need :mmap though but it could help distinguishing between what's been created from the interpreter directly and what's been created by a direct call to mmap. We could instead have cpython:<name> prefix for the interpreter and cpython:[<name>] for what's being used by mmap.

Is it because you're worried about the allowed length? or something else?

@corona10
Copy link
Member Author

Personally, I think we should at least indicate cpython. As I don't have a kernel recent enough, I can't test this, but I guess that seeing "cpython" could help users grepping for whatever is related to cpython. I don't think we really need :mmap though but it could help distinguishing between what's been created from the interpreter directly and what's been created by a direct call to mmap. We could instead have cpython: prefix for the interpreter and cpython:[] for what's being used by mmap.

@vstinner @picnixz

I still prefer to keep the current convention as much as possible. As Bénédikt mentioned, having a common prefix is important for filtering.

Regarding using different conventions for CPython-defined versus user-defined mappings, I would prefer not to introduce additional distinctions that people need to learn or interpret. Keeping things simple and consistent feels more important here.

For that reason, my preference is to maintain the same convention across the board.

If there is no strong objection with this, I hope that I can merge this PR soon.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vstinner
Copy link
Member

Ok, let's add the cpython:mmap: prefix.

@corona10
Copy link
Member Author

@picnixz I think that we are ready to land this feature :)

@corona10 corona10 requested a review from picnixz December 17, 2025 15:05
@corona10 corona10 merged commit 14f0b51 into python:main Dec 18, 2025
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants