How to access array of flexible arrays in cache friendly manner?
问题 I have records with flexible array member typedef struct record { unsigned foo; signed bar; double number[]; } record; I have multiple records with the same amount of numbers so I can arrange them in array. I would like to allocate them into one continuous memory space. const unsigned numbers = ...; const unsigned records = ...; const size_t record_size = sizeof(record) + numbers*sizeof(double); record *prec = malloc(records*record_size); So now I know record_size and I can access it but what