1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-26 13:10:46 +03:00

Attempt to fix GCC warnings

Fixes https://github.com/rui314/mold/issues/1204
This commit is contained in:
Rui Ueyama 2024-02-27 16:38:44 +09:00
parent d4ff48a07e
commit fcda712238

View File

@ -585,9 +585,8 @@ public:
// seem to provide that function. C11's aligned_alloc may not be always
// avialalbe. Therefore, we'll align the buffer ourselves.
i64 size = sizeof(Entry) * this->nbuckets;
entries_buf = malloc(size + alignof(Entry) - 1);
entries_buf = calloc(1, size + alignof(Entry) - 1);
entries = (Entry *)align_to((u64)entries_buf, alignof(Entry));
memset(entries, 0, size);
}
std::pair<T *, bool> insert(std::string_view key, u64 hash, const T &val) {