I am struggling to understand how to calculate the size of the data in a function given its function arguments. For example below is the function foo which has 4 arguments. And if I have to pass its arguments, I need to know how much data this function will pass.
It passes 2 pointers and 2 ints, therefore the size of the data passed in bytes is 2 * (size of pointer) + 2 * (size of int). ie sizeof(*bucket) + sizeof(*work) + 2 * sizeof(int)
The size of random_bucket in bytes is sizeof(random_bucket) and the size of random_work_bucket is sizeof(random_work_bucket).