Skip to content

Commit f19909e

Browse files
committed
gh-142419: Add mmap.set_name method for annotation
1 parent 5ec03cf commit f19909e

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

Modules/clinic/mmapmodule.c.h

Lines changed: 37 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/mmapmodule.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,24 @@ mmap_mmap_seek_impl(mmap_object *self, Py_ssize_t dist, int how)
11161116
return NULL;
11171117
}
11181118

1119+
/*clinic*/
1120+
1121+
/*[clinic input]
1122+
mmap.mmap.set_name
1123+
1124+
name: str
1125+
/
1126+
1127+
[clinic start generated code]*/
1128+
1129+
static PyObject *
1130+
mmap_mmap_set_name_impl(mmap_object *self, const char *name)
1131+
/*[clinic end generated code: output=1edaf4fd51277760 input=6c7dd91cad205f07]*/
1132+
{
1133+
_PyAnnotateMemoryMap(self->data, self->size, name);
1134+
Py_RETURN_NONE;
1135+
}
1136+
11191137
/*[clinic input]
11201138
mmap.mmap.seekable
11211139

0 commit comments

Comments
 (0)