diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-02-28 14:28:31 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-02-28 14:28:31 +1100 |
commit | 94e2fe05b92d1a79fc95beac00f03b58525f8310 (patch) | |
tree | 5f42a7521a983aa942fd47af696e3c6754781268 | |
parent | f1183ccb9c906dac99d7ae41baabe51105ee6d67 (diff) | |
download | mongo-94e2fe05b92d1a79fc95beac00f03b58525f8310.tar.gz |
Fix the configure test for default buffer alignment.
-rw-r--r-- | build_posix/configure.ac.in | 30 | ||||
-rw-r--r-- | src/os_posix/os_alloc.c | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index 5a8ab5fe83a..cd76466b1a0 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -46,21 +46,6 @@ else fi fi -# Linux requires _GNU_SOURCE to be defined and buffers aligned to 512 byte -# boundaries for O_DIRECT to work. -BUFFER_ALIGNMENT=0 -if test "$ac_cv_func_posix_memalign" = "yes" ; then - case "`uname -s`" in - Linux) AM_CFLAGS="$AM_CFLAGS -D_GNU_SOURCE" - BUFFER_ALIGNMENT=512 - ;; - esac -fi -AC_DEFINE_UNQUOTED(WT_BUFFER_ALIGNMENT_DEFAULT, $BUFFER_ALIGNMENT, - [Default alignment of bufffers used for I/O]) - -AC_SUBST(AM_CFLAGS) - AM_CONDITIONAL([DEBUG], [test "$wt_cv_enable_debug" = "yes"]) # Python API @@ -81,6 +66,21 @@ AC_SYS_LARGEFILE AC_C_BIGENDIAN +# Linux requires _GNU_SOURCE to be defined and buffers aligned to 512 byte +# boundaries for O_DIRECT to work. +BUFFER_ALIGNMENT=0 +if test "$ac_cv_func_posix_memalign" = "yes" ; then + case "`uname -s`" in + Linux) AM_CFLAGS="$AM_CFLAGS -D_GNU_SOURCE" + BUFFER_ALIGNMENT=512 + ;; + esac +fi +AC_DEFINE_UNQUOTED(WT_BUFFER_ALIGNMENT_DEFAULT, $BUFFER_ALIGNMENT, + [Default alignment of bufffers used for I/O]) + +AC_SUBST(AM_CFLAGS) + # Is there a link to a BDB tree that we can use for test/format? AM_CONDITIONAL([HAVE_BDB], [test -d ../test/format && test -e db]) diff --git a/src/os_posix/os_alloc.c b/src/os_posix/os_alloc.c index 1bc6e938f15..f52a6109709 100644 --- a/src/os_posix/os_alloc.c +++ b/src/os_posix/os_alloc.c @@ -126,7 +126,7 @@ __wt_realloc_aligned(WT_SESSION_IMPL *session, p = *(void **)retp; - WT_ASSERT(session, p == NULL || bytes_allocated == 0); + WT_ASSERT(session, p == NULL || bytes_allocated != 0); if (p == NULL && session != NULL && S2C(session)->stats != NULL) WT_CSTAT_INCR(session, memalloc); |