Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented Dec 9, 2025

@corona10
Copy link
MemberAuthor

@picnixz@vstinner PTAL :)

@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

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
MemberAuthor

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

@vstinnervstinner 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
MemberAuthor

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

@corona10corona10 merged commit 14f0b51 into python:mainDec 18, 2025
64 checks passed
Sign up for freeto 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

@corona10@vstinner@picnixz@encukou