snapshot.o malloc.o mymemory.o common.o mutex.o conditionvariable.o \
context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o \
sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o newfuzzer.o \
- concretepredicate.o waitobj.o
+ concretepredicate.o waitobj.o hashfunction.o
CPPFLAGS += -Iinclude -I.
LDFLAGS := -ldl -lrt -rdynamic -lpthread
predicate_tree_entry->add_predicate_expr(NOPREDICATE, NULL, true);
predicate_tree_exit = new Predicate(NULL, false, true);
- // Memories that are reclaimed after each execution
+ /* Snapshot data structures below */
action_list_buffer = new SnapList<action_list_t *>();
read_locations = new loc_set_t();
write_locations = new loc_set_t();
- val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0>();
+ val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0, snapshot_malloc, snapshot_calloc, snapshot_free, int64_hash>();
loc_may_equal_map = new HashTable<void *, loc_set_t *, uintptr_t, 0>();
//values_may_read_from = new value_set_t();
action_list_buffer = new SnapList<action_list_t *>();
read_locations = new loc_set_t();
write_locations = new loc_set_t();
- val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0>();
+ val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0, snapshot_malloc, snapshot_calloc, snapshot_free, int64_hash>();
loc_may_equal_map = new HashTable<void *, loc_set_t *, uintptr_t, 0>();
//values_may_read_from = new value_set_t();
inst_id_map.put(next_inst, inst_counter++);
it = it->getNext();
- curr_pred->incr_expl_count();
+ /*-- curr_pred->incr_expl_count(); */
}
curr_pred->set_exit(predicate_tree_exit);
#define __FUNCNODE_H__
#include "hashset.h"
+#include "hashfunction.h"
#include "classlist.h"
#include "threads-model.h"
#define MAX_DIST 10
-typedef ModelList<FuncInst *> func_inst_list_mt;
+typedef ModelList<FuncInst *> func_inst_list_mt;
typedef enum edge_type {
IN_EDGE, OUT_EDGE, BI_EDGE
} edge_type_t;
loc_set_t * write_locations;
/* Keeps track of locations that have the same values written to */
- HashTable<uint64_t, loc_set_t *, uint64_t, 0> * val_loc_map;
+ HashTable<uint64_t, loc_set_t *, uint64_t, 0, snapshot_malloc, snapshot_calloc, snapshot_free, int64_hash> * val_loc_map;
/* Keeps track of locations that may share the same value as key, deduced from val_loc_map */
HashTable<void *, loc_set_t *, uintptr_t, 0> * loc_may_equal_map;
--- /dev/null
+#include "hashfunction.h"
+
+/* Hash function for 64-bit integers */
+unsigned int int64_hash(uint64_t key) {
+ key = (~key) + (key << 18); // key = (key << 18) - key - 1;
+ key = key ^ (key >> 31);
+ key = key * 21; // key = (key + (key << 2)) + (key << 4);
+ key = key ^ (key >> 11);
+ key = key + (key << 6);
+ key = key ^ (key >> 22);
+ return (unsigned int) key;
+}
--- /dev/null
+#ifndef __HASH_FUNCTION__
+#define __HASH_FUNCTION__
+
+#include <stdint.h>
+
+unsigned int int64_hash(uint64_t key);
+
+#endif