MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / Read

Method Read

KittyMemoryEx/KittyMemOp.cpp:95–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94 if (n > 0)
95 {
96 total += n;
97
98 address += n;
99 buffer = static_cast<char *>(buffer) + n;
100 len -= n;
101
102 if (state == KTTransferState::Page)
103 {
104 contiguousSuccess += n;
105
106 if (contiguousSuccess >= KT_RETRY_NORMAL_AFTER)
107 {
108 state = KTTransferState::Normal;
109 contiguousSuccess = 0;
110 }
111 }
112
113 // partial success means remaining bytes are still pending
114 if (n != requestSize && mode == MemMode::Normal)
115 {
116 break;
117 }
118
119 continue;
120 }
121
122 /*
123 * No bytes transferred.
124 */
125
126 if (mode == MemMode::Normal)
127 break;
128
129 if (state == KTTransferState::Normal)
130 {
131 /*
132 * Large request failed.
133 * Switch to page scanning.
134 */
135 state = KTTransferState::Page;
136 contiguousSuccess = 0;
137 continue;
138 }
139
140 /*
141 * Page failed.
142 * Skip it.
143 */
144 size_t skip = std::min(KT_PAGE_REMAIN(address), len);
145

Callers 15

find_r_debugMethod · 0.80
solistMethod · 0.80
somainMethod · 0.80
sonextMethod · 0.80
MemoryPatchMethod · 0.80
get_CurrBytesMethod · 0.80
MemoryBackupMethod · 0.80
get_CurrBytesMethod · 0.80
readMemMethod · 0.80
dumpMemRangeMethod · 0.80
findBytesAllMethod · 0.80
findBytesFirstMethod · 0.80

Calls 3

untagHeepPtrFunction · 0.85
call_process_vm_readvFunction · 0.85
preadMethod · 0.80

Tested by

no test coverage detected