Skip to content

Commit

Permalink
test that sized deallocation really works before enabling it
Browse files Browse the repository at this point in the history
Weirdly, some OSX compiler does allow -fsized-deallocation, yet barks
on any attempt to actually use it at compile time (!). So lets detect
this as well in configure and opt out as necessary.

Should fix issue gperftools#870.
  • Loading branch information
alk committed Feb 21, 2017
1 parent 5618ef7 commit 98753aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,11 @@ AC_CACHE_CHECK([if C++ compiler supports -fsized-deallocation],
[AC_LANG_PUSH(C++)
OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fsized-deallocation"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],
perftools_cv_sized_deallocation_result=yes,
perftools_cv_sized_deallocation_result=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <new>]],
[[(::operator delete)(0, 256)]])],
perftools_cv_sized_deallocation_result=yes,
perftools_cv_sized_deallocation_result=no)
CXXFLAGS="$OLD_CXXFLAGS"
AC_LANG_POP(C++)])

Expand Down

0 comments on commit 98753aa

Please sign in to comment.