typecast address to pointer to byte to avoid unaligned memory access error
diff --git a/include/jemalloc/internal/hash.h b/include/jemalloc/internal/hash.h
index 864fda8..1ff2d9a 100644
--- a/include/jemalloc/internal/hash.h
+++ b/include/jemalloc/internal/hash.h
@@ -53,7 +53,7 @@
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 @@
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);
}