diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-15 02:35:18 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-15 02:35:18 +0000 |
commit | 39cfa67b4f56e0c79afb352b1e9bf5c914b774ca () | |
tree | 5d8ecc18a42670845571857fc767b8b3e0496566 /st.c | |
parent | 21429b1488faf58b6683eef2c9c24e00796a32ae (diff) |
__builtin_assume_aligned for *(foo *) casts
These casts are guarded. Must be safe to assume alignments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | st.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1816,9 +1816,14 @@ st_hash(const void *ptr, size_t len, st_index_t h) } else #endif { do { - h = murmur_step(h, *(st_index_t *)data); data += sizeof(st_index_t); len -= sizeof(st_index_t); } while (len >= sizeof(st_index_t)); @@ -1834,7 +1839,7 @@ st_hash(const void *ptr, size_t len, st_index_t h) case 6: t |= data_at(5) << 40; case 5: t |= data_at(4) << 32; case 4: - t |= (st_index_t)*(uint32_t*)data; goto skip_tail; # define SKIP_TAIL 1 #endif @@ -1859,6 +1864,7 @@ st_hash(const void *ptr, size_t len, st_index_t h) h *= C2; } h ^= l; return murmur_finish(h); } |