@@ -155,8 +155,6 @@ get_page_size(void) {
155155typedef struct page_cache_entry {
156156 uintptr_t page_addr ; // page-aligned base address
157157 char * data ;
158- int valid ;
159- struct page_cache_entry * next ;
160158} page_cache_entry_t ;
161159
162160#define MAX_PAGES 1024
@@ -211,17 +209,13 @@ _Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
211209 PyMem_RawFree (handle -> pages [i ].data );
212210 }
213211 handle -> pages [i ].data = NULL ;
214- handle -> pages [i ].valid = 0 ;
215212 }
216213 handle -> page_cache_count = 0 ;
217214}
218215
219216UNUSED static void
220217_Py_RemoteDebug_ClearCache (proc_handle_t * handle )
221218{
222- for (int i = 0 ; i < handle -> page_cache_count ; i ++ ) {
223- handle -> pages [i ].valid = 0 ;
224- }
225219 handle -> page_cache_count = 0 ;
226220}
227221
@@ -244,7 +238,6 @@ _Py_RemoteDebug_InitProcHandle(proc_handle_t *handle, pid_t pid) {
244238 handle -> page_cache_count = 0 ;
245239 for (int i = 0 ; i < MAX_PAGES ; i ++ ) {
246240 handle -> pages [i ].data = NULL ;
247- handle -> pages [i ].valid = 0 ;
248241 }
249242
250243 handle -> pid = pid ;
@@ -1539,7 +1532,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
15391532 // between profiler samples, so entries are packed at the front.
15401533 for (int i = 0 ; i < handle -> page_cache_count ; i ++ ) {
15411534 page_cache_entry_t * entry = & handle -> pages [i ];
1542- if (entry -> valid && entry -> page_addr == page_base ) {
1535+ if (entry -> page_addr == page_base ) {
15431536 memcpy (out , entry -> data + offset_in_page , size );
15441537 return 0 ;
15451538 }
@@ -1566,7 +1559,6 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
15661559 }
15671560
15681561 entry -> page_addr = page_base ;
1569- entry -> valid = 1 ;
15701562 handle -> page_cache_count ++ ;
15711563 memcpy (out , entry -> data + offset_in_page , size );
15721564 return 0 ;
0 commit comments