MCPcopy Create free account
hub / github.com/F-Stack/f-stack / memtest_compare

Function memtest_compare

app/redis-6.2.6/src/memtest.c:194–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194int memtest_compare(unsigned long *l, size_t bytes, int interactive) {
195 unsigned long words = bytes/sizeof(unsigned long)/2;
196 unsigned long w, *l1, *l2;
197
198 assert((bytes & 4095) == 0);
199 l1 = l;
200 l2 = l1+words;
201 for (w = 0; w < words; w++) {
202 if (*l1 != *l2) {
203 if (interactive) {
204 printf("\n*** MEMORY ERROR DETECTED: %p != %p (%lu vs %lu)\n",
205 (void*)l1, (void*)l2, *l1, *l2);
206 exit(1);
207 }
208 return 1;
209 }
210 l1 ++;
211 l2 ++;
212 if ((w & 0xffff) == 0 && interactive)
213 memtest_progress_step(w,words,'=');
214 }
215 return 0;
216}
217
218int memtest_compare_times(unsigned long *m, size_t bytes, int pass, int times,
219 int interactive)

Callers 1

memtest_compare_timesFunction · 0.85

Calls 2

memtest_progress_stepFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected