有人知道学习 RAM 上的 walkpat 内存测试的任何好的资源吗?如果您可以提供伪代码或 C 代码,那就更好了。提前致谢!
问问题
898 次
1 回答
0
volatile int *ptr; // volatile because the compiler would otherwise outsmart you and not actually read the memory
for(ptr=0; ptr<SIZE; ptr++) {
int test = 1;
do {
*ptr = test;
if( *ptr != test ) FAIL();
test <<= 1; // walk that 1 through the word, until it falls off the end.
} while(test);
}
于 2013-12-16T09:48:24.003 回答