I've made these changes only for FreeBSD and Solaris for the moment. I don't know what should be done on Linux for aligned_alloc/memalign. The current Valgrind code refects the glibc implementation, but not what the documentation says.