On Mon Apr 7 07:55:52 2025 +0000, Lorenzo Ferrillo wrote:
v2: Added 2 function to share common code for various PerfSet...Counter functions, extracted from the already existing PerfSetCounterRefValue Reimplemented new functions using these common functions The address calculation was extracted, but the value write itself was kept in the function proper, as the values to write were of different types and size. Do you think this is enough @julliard ? Or do you have some ideas to make the code better? EDIT: for some reason, having moved the counter address calculation into a function is causing a strange error in 64bit build. (I didn't catch locally, becouse I forgot to build with Werror). I will try to fix shortly.
It looks good, you could probably improve it by returning a counter pointer instead of an index. Also you could have a set function doing a memcpy instead of returning a pointer and casting it.