mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
gh-142419: Add mmap.set_name method for user custom annotation (gh-142480)
This commit is contained in:
parent
d2abd5733b
commit
14f0b5191a
11 changed files with 159 additions and 14 deletions
|
|
@ -77,7 +77,7 @@ jit_alloc(size_t size)
|
|||
unsigned char *memory = mmap(NULL, size, prot, flags, -1, 0);
|
||||
int failed = memory == MAP_FAILED;
|
||||
if (!failed) {
|
||||
_PyAnnotateMemoryMap(memory, size, "cpython:jit");
|
||||
(void)_PyAnnotateMemoryMap(memory, size, "cpython:jit");
|
||||
}
|
||||
#endif
|
||||
if (failed) {
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,8 @@ static void* perf_map_jit_init(void) {
|
|||
close(fd);
|
||||
return NULL; // Memory mapping failed
|
||||
}
|
||||
_PyAnnotateMemoryMap(perf_jit_map_state.mapped_buffer, page_size, "cpython:perf_jit_trampoline");
|
||||
(void)_PyAnnotateMemoryMap(perf_jit_map_state.mapped_buffer, page_size,
|
||||
"cpython:perf_jit_trampoline");
|
||||
#endif
|
||||
|
||||
perf_jit_map_state.mapped_size = page_size;
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ new_code_arena(void)
|
|||
perf_status = PERF_STATUS_FAILED;
|
||||
return -1;
|
||||
}
|
||||
_PyAnnotateMemoryMap(memory, mem_size, "cpython:perf_trampoline");
|
||||
(void)_PyAnnotateMemoryMap(memory, mem_size, "cpython:perf_trampoline");
|
||||
void *start = &_Py_trampoline_func_start;
|
||||
void *end = &_Py_trampoline_func_end;
|
||||
size_t code_size = end - start;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue