From 050f2d28be8a63836bd74558b82be7983770a654 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Sat, 12 Dec 2015 18:27:40 -0800 Subject: [PATCH] use alias attribute only for elf platforms It was reported that clang on OSX doesn't support alias attribute. Most likely because of executable format limitations. New code limits use of alias to gcc-compatible compilers on elf platforms (various gnu and *bsd systems). Elf format is known to support aliases. --- src/tcmalloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index 6f0352f..0941bff 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -1598,7 +1598,7 @@ extern "C" PERFTOOLS_DLL_DECL void tc_free_sized(void *ptr, size_t size) __THROW do_free_with_callback(ptr, &InvalidFree, true, size); } -#if defined(__GNUC__) && !defined(WIN32) +#if defined(__GNUC__) && defined(__ELF__) extern "C" PERFTOOLS_DLL_DECL void tc_delete_sized(void *p, size_t size) throw() __attribute__((alias("tc_free_sized")));