This is a continuation of #20665.
Closes #20722.
129 | + alloc_bhp->flags = 0; 130 | +- atomic_init(&alloc_bhp->ref, 1); 131 | ++ atomic_init_db(&alloc_bhp->ref, 1); 132 | + #ifdef DIAGNOSTIC 133 | + if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { 134 | + __db_errx(env,
Where is the DB_STR("3025", gone?
131 | ++ atomic_init_db(&alloc_bhp->ref, 1); 132 | + #ifdef DIAGNOSTIC 133 | + if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { 134 | + __db_errx(env, 135 | +@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */ 136 | + MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
This was MVCC_MPROTECT(bhp->buf, mfp->pagesize, before.
175 | ++ atomic_init_db(&htab[i].hash_page_dirty, 0); 176 | + } 177 | + 178 | + /* 179 | +@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) 180 | + hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
-@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
- hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
- mtx_base + i;
+@@ -302,7 +302,7 @@ no_prealloc:
+ } else
+ hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount);
@jonasschnelli The patch is an exact copy of https://github.com/bitcoin/bitcoin/blob/master/depends/patches/bdb/clang_cxx_11.patch
Concept ACK (and code review ACK if the patch matches)
ACK 92370033a2606ee88f4d080193e0bf6da481dc2e.
I checked that the patch is the same as what we carry in depends, and that the *.as produced by the script are identical between master and this PR on macOS and Linux. i.e on macOS:
# master 7b975639ef93b50537a3ec6326b54d7218afc8da
CFLAGS="-Wno-error=implicit-function-declaration" ZERO_AR_DATE=1 ./contrib/install_db4.sh $(pwd)
mv db4 db4_master
# checkout [#20906](/bitcoin-bitcoin/20906/)
CFLAGS="-Wno-error=implicit-function-declaration" ZERO_AR_DATE=1 ./contrib/install_db4.sh $(pwd)
diffoscope db4/lib db4_master/lib/ --exclude-directory-metadata=yes
<!--4a62be1de6b64f3ed646cdc7932c8cf5-->
🕵️ @practicalswift has been requested to review this pull request as specified in the REVIEWERS file.
Concept ACK: in-repo is more robust and easier to review than out-of-repo :)
I am concept ACK on this, but why did you choose to change the patch format? This makes the change more difficult to review.
@jamesob The patch format is exactly the same as we use for depends: https://github.com/bitcoin/bitcoin/blob/master/depends/patches/bdb/clang_cxx_11.patch
It would have been easier for reviewers if you made it clear in the PR description that this is now using the depends/patches/bdb/clang_cxx_11.patch and not the one from the gist.
Anyhow—I checked that it (apart from whitespace) matches.
ACK 92370033a2606ee88f4d080193e0bf6da481dc2e