Skip to main content

Practice · 1 of 3

Prove the Hot/Cold Split

CHALLENGE
Difficulty: advanced+25 XP

ISO C. Given struct fat { int id; int score; char name[60]; }; and struct hot { int id; int score; }; (declared for you), implement size_t records_per_line(size_t rec_size) returning how many records of rec_size bytes fit in one 64-byte cache line (integer floor), and int total_score_hot(const struct hot *h, size_t n) summing scores (NULL with n>0 returns -1).

Back to lesson: Practice: Layout and Measurement Drills