Undo all the work on determinism in the driver. New plan soon.
This commit is contained in:
@@ -353,34 +353,18 @@ bool is_lua_comment(const std::string &s) {
|
||||
return s.substr(start, 2) == "--";
|
||||
}
|
||||
|
||||
static std::string get_file_contents(const std::string &fn) {
|
||||
std::ifstream fs(fn);
|
||||
std::stringstream buffer;
|
||||
buffer << fs.rdbuf();
|
||||
return buffer.str();
|
||||
}
|
||||
|
||||
static StringVec read_control_lst(const std::string &path) {
|
||||
StringVec lines = split(get_file_contents(path), '\n');
|
||||
util::StringVec result;
|
||||
for (int i = 0; i < int(lines.size()); i++) {
|
||||
std::string trimmed = trim(lines[i]);
|
||||
if ((trimmed.size() > 0) && (trimmed[0] != '#')) {
|
||||
result.push_back(trimmed);
|
||||
}
|
||||
int hash_of_mallocs() {
|
||||
void *blocks[15];
|
||||
int hash = 0;
|
||||
for (int i = 0; i < 15; i++) {
|
||||
void *blk = malloc(1 << i);
|
||||
blocks[i] = blk;
|
||||
hash = (hash * 17) + (int)(ptrdiff_t)(blk);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
LuaSourcePtr read_lua_source(const std::string &dir) {
|
||||
StringVec files = read_control_lst(dir + "/control.lst");
|
||||
assert (!files.empty());
|
||||
LuaSourcePtr result(new LuaSourceVec);
|
||||
for (const std::string &file : files) {
|
||||
std::string data = get_file_contents(dir + "/" + file);
|
||||
result->emplace_back(file, data);
|
||||
for (int i = 0; i < 15; i++) {
|
||||
free(blocks[i]);
|
||||
}
|
||||
return result;
|
||||
return (hash & 0x7FFFFFFF) | (0x40000000);
|
||||
}
|
||||
|
||||
std::string XYZ::debug_string() const {
|
||||
|
||||
Reference in New Issue
Block a user