I'm facing an homework where I should "fill the register inside the CPU using C++".
While I understand that a single register should be once or twice the word size of the system and the L1 cache should be several dozens kilobytes, I don't understand how I should show that that space has been used up. Also, the flag "register" isn't even a command, it's more similar to a suggestion that the compiler manages as deemed necessary..
So far, I have written two snippets of codes that sum up the scenario that would produce bad allocation of cache memory: an over-sized array flagged as "register" and an infinite recursion which at every iteration allocates memory for a local variable flagged as "register".
I planned to place this code as examples and add an English explanation of the processes involved.
Is there a way to measure the details of the registers/cache memory allocation in a program?
Aucun commentaire:
Enregistrer un commentaire