Fix a regression in JE_COMPILABLE().

Revert JE_COMPILABLE() so that it detects link errors.  Cross-compiling
should still work as long as a valid configure cache is provided.

Clean up some comments/whitespace.
This commit is contained in:
Jason Evans 2012-03-13 11:09:23 -07:00
parent eb2398106f
commit 4c2faa8a7c
3 changed files with 18 additions and 24 deletions

View File

@ -26,11 +26,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
]) ])
dnl JE_COMPILABLE(label, hcode, mcode, rvar) dnl JE_COMPILABLE(label, hcode, mcode, rvar)
dnl
dnl Use AC_RUN_IFELSE() rather than AC_COMPILE_IFELSE() so that linker errors
dnl cause failure.
AC_DEFUN([JE_COMPILABLE], AC_DEFUN([JE_COMPILABLE],
[ [
AC_CACHE_CHECK([whether $1 is compilable], AC_CACHE_CHECK([whether $1 is compilable],
[$4], [$4],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2], [AC_RUN_IFELSE([AC_LANG_PROGRAM([$2],
[$3])], [$3])],
[$4=yes], [$4=yes],
[$4=no])]) [$4=no])])
@ -801,16 +804,13 @@ dnl ============================================================================
dnl Check for ffsl(3), and fail if not found. This function exists on all dnl Check for ffsl(3), and fail if not found. This function exists on all
dnl platforms that jemalloc currently has a chance of functioning on without dnl platforms that jemalloc currently has a chance of functioning on without
dnl modification. dnl modification.
JE_COMPILABLE([a program using ffsl], JE_COMPILABLE([a program using ffsl], [
[
#include <string.h> #include <string.h>
], ], [
[
{ {
int rv = ffsl(0x08); int rv = ffsl(0x08);
} }
], ], [je_cv_function_ffsl])
[je_cv_function_ffsl])
if test "x${je_cv_function_ffsl}" != "xyes" ; then if test "x${je_cv_function_ffsl}" != "xyes" ; then
AC_MSG_ERROR([Cannot build without ffsl(3)]) AC_MSG_ERROR([Cannot build without ffsl(3)])
fi fi

View File

@ -566,10 +566,7 @@ sa2u(size_t size, size_t alignment, size_t *run_size_p)
} }
} }
/* /* Choose an arena based on a per-thread value. */
* Choose an arena based on a per-thread value (fast-path code, calls slow-path
* code if necessary).
*/
JEMALLOC_INLINE arena_t * JEMALLOC_INLINE arena_t *
choose_arena(void) choose_arena(void)
{ {

View File

@ -101,10 +101,7 @@ arenas_extend(unsigned ind)
return (arenas[0]); return (arenas[0]);
} }
/* /* Slow path, called only by choose_arena(). */
* Choose an arena based on a per-thread value (slow-path code only, called
* only by choose_arena()).
*/
arena_t * arena_t *
choose_arena_hard(void) choose_arena_hard(void)
{ {