Thanks for the pointers. I read the source code after commenting. According to that definition, I think it would be proper to just use FREE(), as it says it discards the old data. A realloc would probably incur in an unneeded copy. At least that's how the traditional realloc works, I ignore how mesa_realloc works, but I assume they chose to name it realloc because it works like realloc. In that case, either the documentation is wrong for data == NULL (as it wouldn't copy anything and the original data will still be there) or realloc shouldn't be used, as it contradicts the documentation in this case.
Originally Posted by siavashserver