Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Add a simple rule-tree benchmarks. #14485

Merged
merged 2 commits into from Dec 19, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

style: Use a HashSet in free-list check.

  • Loading branch information
emilio committed Dec 19, 2016
commit fc6bed28ff82913da497ab561ff6a31869dfe24a
@@ -468,18 +468,19 @@ impl StrongRuleNode {
}

unsafe fn assert_free_list_has_no_duplicates_or_null(&self) {
assert!(cfg!(debug_assertions));
assert!(cfg!(debug_assertions), "This is an expensive check!");
use std::collections::HashSet;

let me = &*self.ptr;
assert!(me.is_root());

let mut current = self.ptr;
let mut seen = vec![];
let mut seen = HashSet::new();
while current != FREE_LIST_SENTINEL {
let next = (*current).next_free.load(Ordering::SeqCst);
assert!(!next.is_null());
assert!(!seen.contains(&next));
seen.push(next);
seen.insert(next);

current = next;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.