Commit 17d9bd69 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

fixes #5684 do not memset on fake_db. only set the cmp descriptor.


git-svn-id: file:///svn/toku/tokudb@50063 c7de825b-a66e-492c-adef-691d508d4ae1
parent aab744ac
...@@ -485,15 +485,11 @@ struct ft { ...@@ -485,15 +485,11 @@ struct ft {
bool blackhole; bool blackhole;
}; };
// Copy the descriptor into a temporary variable, and tell DRD that subsequent code happens after reading that pointer. // Allocate a DB struct off the stack and only set its comparison
// In combination with the annotation in toku_ft_update_descriptor, this seems to be enough to convince test_4015 that all is well. // descriptor. We don't bother setting any other fields because
// Otherwise, drd complains that the newly malloc'd descriptor string is touched later by some comparison operation. // the comparison function doesn't need it, and we would like to
static inline void setup_fake_db (DB *fake_db, DESCRIPTOR orig_desc) { // reduce the CPU work done per comparison.
memset(fake_db, 0, sizeof *fake_db); #define FAKE_DB(db, desc) struct __toku_db db; fake_db->cmp_descriptor = desc;
fake_db->cmp_descriptor = orig_desc;
}
#define FAKE_DB(db, desc) struct __toku_db db; setup_fake_db(&db, (desc));
struct ft_options { struct ft_options {
unsigned int nodesize; unsigned int nodesize;
......
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