From 291ac33e363ce8a7b39441c0fa5c8e44ff84cdc6 Mon Sep 17 00:00:00 2001 From: weiyu Date: Fri, 4 Oct 2019 18:36:29 -0700 Subject: [PATCH] Add default memory allocation and free functions for HSIterator and some other tiny stuff --- concretepredicate.cc | 5 ----- concretepredicate.h | 2 +- funcnode.cc | 4 ++++ hashset.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/concretepredicate.cc b/concretepredicate.cc index 9633e6c7..79643bee 100644 --- a/concretepredicate.cc +++ b/concretepredicate.cc @@ -5,11 +5,6 @@ ConcretePredicate::ConcretePredicate(thread_id_t tid) : expressions() {} -ConcretePredicate::~ConcretePredicate() -{ - expressions.clear(); -} - void ConcretePredicate::add_expression(token_t token, uint64_t value, bool equality) { expressions.push_back(concrete_pred_expr(token, value, equality)); diff --git a/concretepredicate.h b/concretepredicate.h index f0eaeea9..c3b81bd9 100644 --- a/concretepredicate.h +++ b/concretepredicate.h @@ -9,7 +9,7 @@ class ConcretePredicate { public: ConcretePredicate(thread_id_t tid); - ~ConcretePredicate(); + ~ConcretePredicate() {} void add_expression(token_t token, uint64_t value, bool equality); SnapVector * getExpressions() { return &expressions; } diff --git a/funcnode.cc b/funcnode.cc index bf8971bd..18d7771b 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -640,6 +640,10 @@ void FuncNode::add_out_edge(FuncNode * other) } } +/* Compute the distance between this FuncNode and the target node. + * Return -1 if the target node is unreachable or the actual distance + * is greater than max_step. + */ int FuncNode::compute_distance(FuncNode * target, int max_step) { SnapList queue; diff --git a/hashset.h b/hashset.h index baf6d43e..d660620f 100644 --- a/hashset.h +++ b/hashset.h @@ -21,7 +21,7 @@ struct LinkNode { template class HashSet; -template, bool (*equals)(_Key, _Key) = default_equals<_Key> > +template, bool (*equals)(_Key, _Key) = default_equals<_Key> > class HSIterator { public: HSIterator(LinkNode<_Key> *_curr, HashSet <_Key, _KeyInt, _Shift, _malloc, _calloc, _free, hash_function, equals> * _set) : -- 2.34.1