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) { ...@@ -330,7 +330,7 @@ void locktree::sto_migrate_buffer_ranges_to_tree(void *prepared_lkr) {
bool locktree::sto_try_acquire(void *prepared_lkr, bool locktree::sto_try_acquire(void *prepared_lkr,
TXNID txnid, TXNID txnid,
const DBT *left_key, const DBT *right_key) { 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 can do the optimization because the rangetree is empty, and
// we know its worth trying because the sto score is big enough. // we know its worth trying because the sto score is big enough.
sto_begin(txnid); sto_begin(txnid);
......
...@@ -143,9 +143,11 @@ PATENT RIGHTS GRANT: ...@@ -143,9 +143,11 @@ PATENT RIGHTS GRANT:
// racey access to src for the next sizeof(*src) bytes // racey access to src for the next sizeof(*src) bytes
template <typename T> template <typename T>
T toku_drd_unsafe_fetch(T *src) { T toku_drd_unsafe_fetch(T *src) {
VALGRIND_HG_DISABLE_CHECKING(src, sizeof *src);
TOKU_DRD_IGNORE_VAR(*src); TOKU_DRD_IGNORE_VAR(*src);
T val = *src; T val = *src;
TOKU_DRD_STOP_IGNORING_VAR(*src); TOKU_DRD_STOP_IGNORING_VAR(*src);
VALGRIND_HG_ENABLE_CHECKING(src, sizeof *src);
return val; return val;
} }
...@@ -153,7 +155,9 @@ T toku_drd_unsafe_fetch(T *src) { ...@@ -153,7 +155,9 @@ T toku_drd_unsafe_fetch(T *src) {
// racey access to dest for the next sizeof(*dest) bytes // racey access to dest for the next sizeof(*dest) bytes
template <typename T> template <typename T>
void toku_drd_unsafe_set(T *dest, const T src) { void toku_drd_unsafe_set(T *dest, const T src) {
VALGRIND_HG_DISABLE_CHECKING(dest, sizeof *dest);
TOKU_DRD_IGNORE_VAR(*dest); TOKU_DRD_IGNORE_VAR(*dest);
*dest = src; *dest = src;
TOKU_DRD_STOP_IGNORING_VAR(*dest); 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