https://github.com/python/cpython/commit/7eaef74561c27865496505913d19eec7bb3fbcf5
commit: 7eaef74561c27865496505913d19eec7bb3fbcf5
branch: main
author: Pablo Galindo Salgado <[email protected]>
committer: pablogsal <[email protected]>
date: 2025-01-31T14:08:48Z
summary:

gh-129430: Make walking vm regions more efficient in MacOS (#129494)

files:
M Modules/_testexternalinspection.c

diff --git a/Modules/_testexternalinspection.c 
b/Modules/_testexternalinspection.c
index 5a28c0e266226b..22074c81b7405f 100644
--- a/Modules/_testexternalinspection.c
+++ b/Modules/_testexternalinspection.c
@@ -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;
         }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to