Fix incompatible aliasing warnings

We aliased functions with different signatures and gcc now correctly
gives warning for that. Originally gcc 5 same code merging feature
caused us to alias more than necessary, but I am not able to reproduce
this problem anymore. So we're now aliasing only compatible functions.
This commit is contained in:
Aliaksey Kandratsenka 2018-08-05 18:54:01 -07:00
parent 8dd3040358
commit 71c8cedaca
2 changed files with 4 additions and 20 deletions

View File

@ -126,9 +126,9 @@ void operator delete[](void *p, size_t size) CPP_NOTHROW
#else /* !ENABLE_SIZED_DELETE && !ENABLE_DYN_SIZED_DELETE */
void operator delete(void *p, size_t size) CPP_NOTHROW
ALIAS(tc_delete);
ALIAS(tc_delete_sized);
void operator delete[](void *p, size_t size) CPP_NOTHROW
ALIAS(tc_deletearray);
ALIAS(tc_deletearray_sized);
#endif /* !ENABLE_SIZED_DELETE && !ENABLE_DYN_SIZED_DELETE */
@ -197,9 +197,9 @@ void operator delete[](void *p, size_t size, std::align_val_t al) CPP_NOTHROW
#else /* defined(ENABLE_DYN_SIZED_DELETE) */
void operator delete(void *p, size_t size, std::align_val_t al) CPP_NOTHROW
ALIAS(tc_delete);
ALIAS(tc_delete_sized_aligned);
void operator delete[](void *p, size_t size, std::align_val_t al) CPP_NOTHROW
ALIAS(tc_deletearray);
ALIAS(tc_deletearray_sized_aligned);
#endif /* defined(ENABLE_DYN_SIZED_DELETE) */

View File

@ -1998,9 +1998,6 @@ TC_ALIAS(tc_free);
// (via ::operator delete(ptr, nothrow)).
// But it's really the same as normal delete, so we just do the same thing.
extern "C" PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, const std::nothrow_t&) PERFTOOLS_NOTHROW
#ifdef TC_ALIAS
TC_ALIAS(tc_free);
#else
{
if (PREDICT_FALSE(!base::internal::delete_hooks_.empty())) {
tcmalloc::invoke_hooks_and_free(p);
@ -2008,7 +2005,6 @@ TC_ALIAS(tc_free);
}
do_free(p);
}
#endif
extern "C" PERFTOOLS_DLL_DECL void* tc_newarray(size_t size)
#ifdef TC_ALIAS
@ -2080,33 +2076,21 @@ extern "C" PERFTOOLS_DLL_DECL void* tc_new_aligned_nothrow(size_t size, std::ali
}
extern "C" PERFTOOLS_DLL_DECL void tc_delete_aligned(void* p, std::align_val_t) PERFTOOLS_NOTHROW
#ifdef TC_ALIAS
TC_ALIAS(tc_delete);
#else
{
free_fast_path(p);
}
#endif
// There is no easy way to obtain the actual size used by do_memalign to allocate aligned storage, so for now
// just ignore the size. It might get useful in the future.
extern "C" PERFTOOLS_DLL_DECL void tc_delete_sized_aligned(void* p, size_t size, std::align_val_t align) PERFTOOLS_NOTHROW
#ifdef TC_ALIAS
TC_ALIAS(tc_delete);
#else
{
free_fast_path(p);
}
#endif
extern "C" PERFTOOLS_DLL_DECL void tc_delete_aligned_nothrow(void* p, std::align_val_t, const std::nothrow_t&) PERFTOOLS_NOTHROW
#ifdef TC_ALIAS
TC_ALIAS(tc_delete);
#else
{
free_fast_path(p);
}
#endif
extern "C" PERFTOOLS_DLL_DECL void* tc_newarray_aligned(size_t size, std::align_val_t align)
#ifdef TC_ALIAS