Commit 521ada59 authored by Leif Walsh's avatar Leif Walsh

fixed some helgrind warnings in ydb/helgrind_test_groupcommit_count.tdb

parent 5a3e4d4f
......@@ -330,7 +330,7 @@ void locktree::sto_migrate_buffer_ranges_to_tree(void *prepared_lkr) {
bool locktree::sto_try_acquire(void *prepared_lkr,
TXNID txnid,
const DBT *left_key, const DBT *right_key) {
if (m_rangetree->is_empty() && m_sto_buffer.is_empty() && m_sto_score >= STO_SCORE_THRESHOLD) {
if (m_rangetree->is_empty() && m_sto_buffer.is_empty() && toku_drd_unsafe_fetch(&m_sto_score) >= STO_SCORE_THRESHOLD) {
// We can do the optimization because the rangetree is empty, and
// we know its worth trying because the sto score is big enough.
sto_begin(txnid);
......
......@@ -143,9 +143,11 @@ PATENT RIGHTS GRANT:
// racey access to src for the next sizeof(*src) bytes
template <typename T>
T toku_drd_unsafe_fetch(T *src) {
VALGRIND_HG_DISABLE_CHECKING(src, sizeof *src);
TOKU_DRD_IGNORE_VAR(*src);
T val = *src;
TOKU_DRD_STOP_IGNORING_VAR(*src);
VALGRIND_HG_ENABLE_CHECKING(src, sizeof *src);
return val;
}
......@@ -153,7 +155,9 @@ T toku_drd_unsafe_fetch(T *src) {
// racey access to dest for the next sizeof(*dest) bytes
template <typename T>
void toku_drd_unsafe_set(T *dest, const T src) {
VALGRIND_HG_DISABLE_CHECKING(dest, sizeof *dest);
TOKU_DRD_IGNORE_VAR(*dest);
*dest = src;
TOKU_DRD_STOP_IGNORING_VAR(*dest);
VALGRIND_HG_ENABLE_CHECKING(dest, sizeof *dest);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment