@@ -1,13 +1,22 @@
11diff --git a/dbinc/atomic.h b/dbinc/atomic.h
2−index 0034dcc..fa7ba93 100644
2+index 0034dcc..160c8ea 100644
33--- a/dbinc/atomic.h
44+++ b/dbinc/atomic.h
5+@@ -70,7 +70,7 @@ typedef struct {
6+ * These have no memory barriers; the caller must include them when necessary.
7+ */
8+ #define atomic_read(p) ((p)->value)
9+-#define atomic_init(p, val) ((p)->value = (val))
10++#define atomic_init_db(p, val) ((p)->value = (val))
11+
12+ #ifdef HAVE_ATOMIC_SUPPORT
13+
514@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
615 #define atomic_inc(env, p) __atomic_inc(p)
716 #define atomic_dec(env, p) __atomic_dec(p)
817 #define atomic_compare_exchange(env, p, o, n) \
918- __atomic_compare_exchange((p), (o), (n))
10−+ __db_atomic_compare_exchange((p), (o), (n))
19++ __atomic_compare_exchange_int((p), (o), (n))
1120 static inline int __atomic_inc(db_atomic_t *p)
1221 {
1322 int temp;
@@ -16,7 +25,130 @@ index 0034dcc..fa7ba93 100644
1625 * which configure could be changed to use.
1726 */
1827-static inline int __atomic_compare_exchange(
19−+static inline int __db_atomic_compare_exchange(
28++static inline int __atomic_compare_exchange_int(
2029 db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
2130 {
2231 atomic_value_t was;
32+@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
33+ #define atomic_dec(env, p) (--(p)->value)
34+ #define atomic_compare_exchange(env, p, oldval, newval) \
35+ (DB_ASSERT(env, atomic_read(p) == (oldval)), \
36+- atomic_init(p, (newval)), 1)
37++ atomic_init_db(p, (newval)), 1)
38+ #else
39+ #define atomic_inc(env, p) __atomic_inc(env, p)
40+ #define atomic_dec(env, p) __atomic_dec(env, p)
41+diff --git a/dbinc/db.in b/dbinc/db.in
42+index 9fc6712..7428e0a 100644
43+--- a/dbinc/db.in
44++++ b/dbinc/db.in
45+@@ -2413,7 +2413,7 @@ typedef struct {
46+ #define fetch(a) __db_dbm_fetch@DB_VERSION_UNIQUE_NAME@(a)
47+ #define firstkey __db_dbm_firstkey@DB_VERSION_UNIQUE_NAME@
48+ #define nextkey(a) __db_dbm_nextkey@DB_VERSION_UNIQUE_NAME@(a)
49+-#define store(a, b) __db_dbm_store@DB_VERSION_UNIQUE_NAME@(a, b)
50++#define store_db(a, b) __db_dbm_store@DB_VERSION_UNIQUE_NAME@(a, b)
51+
52+ /*******************************************************
53+ * Hsearch historic interface.
54+diff --git a/mp/mp_fget.c b/mp/mp_fget.c
55+index 5fdee5a..0b75f57 100644
56+--- a/mp/mp_fget.c
57++++ b/mp/mp_fget.c
58+@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */
59+
60+ /* Initialize enough so we can call __memp_bhfree. */
61+ alloc_bhp->flags = 0;
62+- atomic_init(&alloc_bhp->ref, 1);
63++ atomic_init_db(&alloc_bhp->ref, 1);
64+ #ifdef DIAGNOSTIC
65+ if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
66+ __db_errx(env,
67+@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */
68+ MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
69+ PROT_READ);
70+
71+- atomic_init(&alloc_bhp->ref, 1);
72++ atomic_init_db(&alloc_bhp->ref, 1);
73+ MUTEX_LOCK(env, alloc_bhp->mtx_buf);
74+ alloc_bhp->priority = bhp->priority;
75+ alloc_bhp->pgno = bhp->pgno;
76+diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c
77+index 34467d2..f05aa0c 100644
78+--- a/mp/mp_mvcc.c
79++++ b/mp/mp_mvcc.c
80+@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
81+ #else
82+ memcpy(frozen_bhp, bhp, SSZA(BH, buf));
83+ #endif
84+- atomic_init(&frozen_bhp->ref, 0);
85++ atomic_init_db(&frozen_bhp->ref, 0);
86+ if (mutex != MUTEX_INVALID)
87+ frozen_bhp->mtx_buf = mutex;
88+ else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
89+@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
90+ #endif
91+ alloc_bhp->mtx_buf = mutex;
92+ MUTEX_LOCK(env, alloc_bhp->mtx_buf);
93+- atomic_init(&alloc_bhp->ref, 1);
94++ atomic_init_db(&alloc_bhp->ref, 1);
95+ F_CLR(alloc_bhp, BH_FROZEN);
96+ }
97+
98+diff --git a/mp/mp_region.c b/mp/mp_region.c
99+index e6cece9..ddbe906 100644
100+--- a/mp/mp_region.c
101++++ b/mp/mp_region.c
102+@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
103+ MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
104+ return (ret);
105+ SH_TAILQ_INIT(&htab[i].hash_bucket);
106+- atomic_init(&htab[i].hash_page_dirty, 0);
107++ atomic_init_db(&htab[i].hash_page_dirty, 0);
108+ }
109+
110+ /*
111+@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
112+ hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
113+ mtx_base + i;
114+ SH_TAILQ_INIT(&hp->hash_bucket);
115+- atomic_init(&hp->hash_page_dirty, 0);
116++ atomic_init_db(&hp->hash_page_dirty, 0);
117+ #ifdef HAVE_STATISTICS
118+ hp->hash_io_wait = 0;
119+ hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
120+diff --git a/mutex/mut_method.c b/mutex/mut_method.c
121+index 2588763..5c6d516 100644
122+--- a/mutex/mut_method.c
123++++ b/mutex/mut_method.c
124+@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval)
125+ MUTEX_LOCK(env, mtx);
126+ ret = atomic_read(v) == oldval;
127+ if (ret)
128+- atomic_init(v, newval);
129++ atomic_init_db(v, newval);
130+ MUTEX_UNLOCK(env, mtx);
131+
132+ return (ret);
133+diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c
134+index f3922e0..e40fcdf 100644
135+--- a/mutex/mut_tas.c
136++++ b/mutex/mut_tas.c
137+@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags)
138+
139+ #ifdef HAVE_SHARED_LATCHES
140+ if (F_ISSET(mutexp, DB_MUTEX_SHARED))
141+- atomic_init(&mutexp->sharecount, 0);
142++ atomic_init_db(&mutexp->sharecount, 0);
143+ else
144+ #endif
145+ if (MUTEX_INIT(&mutexp->tas)) {
146+@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex)
147+ F_CLR(mutexp, DB_MUTEX_LOCKED);
148+ /* Flush flag update before zeroing count */
149+ MEMBAR_EXIT();
150+- atomic_init(&mutexp->sharecount, 0);
151++ atomic_init_db(&mutexp->sharecount, 0);
152+ } else {
153+ DB_ASSERT(env, sharecount > 0);
154+ MEMBAR_EXIT();