Skip to content

Commit

Permalink
Attempt to fix GCC warnings
Browse files Browse the repository at this point in the history
Fixes #1204
  • Loading branch information
rui314 committed Feb 27, 2024
1 parent d4ff48a commit fcda712
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,8 @@ class ConcurrentMap {
// 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) {
Expand Down

0 comments on commit fcda712

Please sign in to comment.