This is just a suggestion for the FREERTOS:
Could the size of the requested memory chunk be passed as argument to this function?
* It is better than void argument.
My motivation to post his suggestion is that a bug in my application cause the pvPortMalloc function be called with a higher value. In my case the value is directly related to the content of a file and the file (hand made for a test) was wrong. So the argument in the malloc failed hook would be helped me.
May be someone could share more examples of the usage of the argument in the malloc failed hook.