summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-05-28 05:20:31 +0000
committerAlex Gorrod <alexg@wiredtiger.com>2015-05-28 05:20:31 +0000
commita408802f5e6f217b69ada21cc682bd6737bb2fd8 (patch)
tree868e58b47763a9f4521c6e781423cd42e6a7e16c
parentd5695703041bb7806d0ed5111edb11a358efa74d (diff)
parent37516adbb188c63f1f3999e06890e0468c036898 (diff)
downloadmongo-a408802f5e6f217b69ada21cc682bd6737bb2fd8.tar.gz
Merge branch 'develop' into compact-early-exit
-rw-r--r--build_posix/aclocal/ax_func_posix_memalign.m450
-rw-r--r--build_posix/configure.ac.in6
-rw-r--r--src/txn/txn.c4
3 files changed, 57 insertions, 3 deletions
diff --git a/build_posix/aclocal/ax_func_posix_memalign.m4 b/build_posix/aclocal/ax_func_posix_memalign.m4
new file mode 100644
index 00000000000..bd60adcbc81
--- /dev/null
+++ b/build_posix/aclocal/ax_func_posix_memalign.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_func_posix_memalign.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FUNC_POSIX_MEMALIGN
+#
+# DESCRIPTION
+#
+# Some versions of posix_memalign (notably glibc 2.2.5) incorrectly apply
+# their power-of-two check to the size argument, not the alignment
+# argument. AX_FUNC_POSIX_MEMALIGN defines HAVE_POSIX_MEMALIGN if the
+# power-of-two check is correctly applied to the alignment argument.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 7
+
+AC_DEFUN([AX_FUNC_POSIX_MEMALIGN],
+[AC_CACHE_CHECK([for working posix_memalign],
+ [ax_cv_func_posix_memalign_works],
+ [AC_TRY_RUN([
+#include <stdlib.h>
+
+int
+main ()
+{
+ void *buffer;
+
+ /* Some versions of glibc incorrectly perform the alignment check on
+ * the size word. */
+ exit (posix_memalign (&buffer, sizeof(void *), 123) != 0);
+}
+ ],
+ [ax_cv_func_posix_memalign_works=yes],
+ [ax_cv_func_posix_memalign_works=no],
+ [ax_cv_func_posix_memalign_works=no])])
+if test "$ax_cv_func_posix_memalign_works" = "yes" ; then
+ AC_DEFINE([HAVE_POSIX_MEMALIGN], [1],
+ [Define to 1 if `posix_memalign' works.])
+fi
+])
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in
index d93793a997b..4bfb4df7fa2 100644
--- a/build_posix/configure.ac.in
+++ b/build_posix/configure.ac.in
@@ -80,12 +80,16 @@ AC_CHECK_LIB(rt, sched_yield)
AC_CHECK_FUNCS([\
clock_gettime fallocate fcntl fread_unlocked ftruncate gettimeofday\
- posix_fadvise posix_fallocate posix_madvise posix_memalign\
+ posix_fadvise posix_fallocate posix_madvise\
strtouq sync_file_range])
# OS X wrongly reports that it has fdatasync
AS_CASE([$host_os], [darwin*], [], [AC_CHECK_FUNCS([fdatasync])])
+# Check for posix_memalign explicitly: it is a builtin in some compilers and
+# the generic declaration in AC_CHECK_FUNCS is incompatible.
+AX_FUNC_POSIX_MEMALIGN
+
AC_SYS_LARGEFILE
AC_C_BIGENDIAN
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 1e28d9362ec..6811e7b2adf 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -396,8 +396,8 @@ __wt_txn_release(WT_SESSION_IMPL *session)
*/
__wt_txn_release_snapshot(session);
txn->isolation = session->isolation;
- F_CLR(txn, WT_TXN_ERROR | WT_TXN_HAS_ID |
- WT_TXN_NAMED_SNAPSHOT | WT_TXN_READONLY | WT_TXN_RUNNING);
+ /* Ensure the transaction flags are cleared on exit */
+ txn->flags = 0;
}
/*