The ffma_mem_realloc mimics the behaviour of realloc and therefore should have the same signature, the pointer to resize and the new size.
The function should also check if the new size still fit in the size class of the allocation, if yes it can just return the existing pointer avoiding further allocations! This specific case is extremely common in cachegrand.
This PR introduces these 2 fixes and update the code to take into account these changes as some functionalities were relying on ffma_mem_realloc zero-ing the memory and therefore now need to do it by themselves.
The ffma_mem_realloc mimics the behaviour of realloc and therefore should have the same signature, the pointer to resize and the new size.
The function should also check if the new size still fit in the size class of the allocation, if yes it can just return the existing pointer avoiding further allocations! This specific case is extremely common in cachegrand.
This PR introduces these 2 fixes and update the code to take into account these changes as some functionalities were relying on ffma_mem_realloc zero-ing the memory and therefore now need to do it by themselves.