Getting ready to shift to dlmalloc

This commit is contained in:
2022-02-23 17:29:49 -05:00
parent 6a9bf4ca42
commit f2ab8d9e34
7 changed files with 6424 additions and 20 deletions

View File

@@ -353,20 +353,6 @@ bool is_lua_comment(const std::string &s) {
return s.substr(start, 2) == "--";
}
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);
}
for (int i = 0; i < 15; i++) {
free(blocks[i]);
}
return (hash & 0x7FFFFFFF) | (0x40000000);
}
std::string XYZ::debug_string() const {
std::ostringstream oss;
oss << "(" << x << "," << y << "," << z << ")";