You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix alignment issues in synchronization_common.h (halide#6272)
* Fix alignment issues in synchronization_common.h
To work around old COMDAT issues, we allocated the table as a char array and cast it to what we want; unfortunately this doesn't guarantee the right alignment for the table and in some environments (eg wasm) we can get unaligned-access failures.
We could fix this by forcing the right alignment, but since we fixed COMDAT issues in another way a while back (adding smarts to LLVM_Runtime_Linker), let's just remove the hack and declare it normally.
Also added some drive-by changes to ensure that the hashtable size and HASH_TABLE_BITS were safe (this happened to be the case before but wasn't enforced), and also to init all the fields in hash_bucket.
(Q: do we really need `check_hash()` to exist? With the mods in place above, is it possible for addr_hash() to return a bad index?)
* Always use HASH_TABLE_BITS in addr_hash()
* Only use check_hash() in DEBUG_RUNTIME builds
0 commit comments