mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-17 16:11:42 +03:00
typecast address to pointer to byte to avoid unaligned memory access error
This commit is contained in:
parent
c3ab90483f
commit
b40253a93e
1 changed files with 2 additions and 2 deletions
|
|
@ -53,7 +53,7 @@ hash_get_block_32(const uint32_t *p, int i)
|
|||
if (unlikely((uintptr_t)p & (sizeof(uint32_t)-1)) != 0) {
|
||||
uint32_t ret;
|
||||
|
||||
memcpy(&ret, &p[i], sizeof(uint32_t));
|
||||
memcpy(&ret, (uint8_t *)(p + i), sizeof(uint32_t));
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ hash_get_block_64(const uint64_t *p, int i)
|
|||
if (unlikely((uintptr_t)p & (sizeof(uint64_t)-1)) != 0) {
|
||||
uint64_t ret;
|
||||
|
||||
memcpy(&ret, &p[i], sizeof(uint64_t));
|
||||
memcpy(&ret, (uint8_t *)(p + i), sizeof(uint64_t));
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue