store_buff.c
来自「代码优化,有效使用内存,透视优化技术,对比优化方法,如果你在追求代码效率的最大化」· C语言 代码 · 共 34 行
C
34 行
/* ---------------------------------------------------------------------------
*
* DEMONSTRATION OF SPONTANEOUS FLUSHING OF STORE BUFFERS
* =====================================================
*
* Build 0x001 08.08.2002
--------------------------------------------------------------------------- */
#include <DoCPU.h>
#include "store_buff.h" // h-file is generated automatically
// by the make-file and contains definition of N_ITER,
// which stands for number of write iterations
main()
{
int *p;
int a, b;
int *buff;
// allocating memory
p = (int *) malloc(1*M);
// sleep, in order to hit exact time quantum
Sleep(100);
// call store_buf.xm
buff = DoCPU(&p);
// display measurement results
printf("%d",N_ITER);for(a = 0; a < 10; a++) printf("\t%d",buff[a]);
printf("\n");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?