Fix the compile error on mac for memcheck mode