Skip to content

Commit

Permalink
pythongh-129430: Make walking vm regions more efficient in MacOS (pyt…
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal authored and srinivasreddy committed Feb 7, 2025
1 parent 3015807 commit aaa2f94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Modules/_testexternalinspection.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ search_map_for_section(pid_t pid, const char* secname, const char* substr) {
&count,
&object_name) == KERN_SUCCESS)
{
int path_len = proc_regionfilename(
pid, address, map_filename, MAXPATHLEN);
if (path_len == 0) {
if ((region_info.protection & VM_PROT_READ) == 0
|| (region_info.protection & VM_PROT_EXECUTE) == 0) {
address += size;
continue;
}

if ((region_info.protection & VM_PROT_READ) == 0
|| (region_info.protection & VM_PROT_EXECUTE) == 0) {
int path_len = proc_regionfilename(
pid, address, map_filename, MAXPATHLEN);
if (path_len == 0) {
address += size;
continue;
}
Expand Down

0 comments on commit aaa2f94

Please sign in to comment.