MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / lookup

Method lookup

cache/cache.cpp:76–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76bool Cache::lookup(const string &s) {
77 static const string default_value("XXX");
78 // Alive IR is bulky, so send a hash of it over to the cache. If
79 // this still uses too much RAM, the next step will be to use a
80 // Bloom filter
81 string remote_data, crc_string = to_string(string_crc(s));
82 if (remote_get(crc_string, remote_data, ctx)) {
83 assert(remote_data == default_value);
84 return true;
85 } else {
86 remote_set(crc_string, default_value, ctx);
87 return false;
88 }
89}
90
91Cache::Cache(unsigned port, bool allow_version_mismatch) {
92 const char *hostname = "127.0.0.1";

Callers

nothing calls this directly

Calls 4

to_stringFunction · 0.85
string_crcFunction · 0.85
remote_getFunction · 0.85
remote_setFunction · 0.85

Tested by

no test coverage detected