struct cacheline
{
int x[16];
};
struct cacheline *block = malloc(sizeof(struct cacheline) *size); //malloc for array of stucts
write_start = clock();
for (k=0;k<=1000;k=k+1){
for (i=1;i<=size;i=i+1){
for(j=0;j<16;j=j+1){
block[i].x[j] = j+1; ///some operation
}
}
}
write_stop = clock();
Elapsed_write_time = (double)(write_stop - write_start)/1000 * 16;
printf("Elapsed time: %f\n",Elapsed_write_time);
free(block); //free the araray of structs
Я пытаюсь освободить массив stucts и я получаю ошибку follwoing.Я пытаюсь свободный массив stuct но получить бесплатно(): недопустимый следующий размер (быстро): 0x0000000000afa010
'i = 1; i <=size' -->' i = 0; i
BLUEPIXY