Index: src/serialize.h |
diff --git a/src/serialize.h b/src/serialize.h |
index bd0c423a6aa8281838806e682afdabd7723b641e..5dc73745baab1d08cea857372b94a5bc8e7644a5 100644 |
--- a/src/serialize.h |
+++ b/src/serialize.h |
@@ -482,11 +482,13 @@ class SerializedData { |
protected: |
void SetHeaderValue(int offset, int value) { |
- reinterpret_cast<int*>(data_)[offset] = value; |
+ memcpy(reinterpret_cast<int*>(data_) + offset, &value, sizeof(value)); |
} |
int GetHeaderValue(int offset) const { |
- return reinterpret_cast<const int*>(data_)[offset]; |
+ int value; |
+ memcpy(&value, reinterpret_cast<int*>(data_) + offset, sizeof(value)); |
+ return value; |
} |
void AllocateData(int size); |
@@ -544,6 +546,10 @@ class Deserializer: public SerializerDeserializer { |
bool ReserveSpace(); |
+ void UnalignedCopy(Object** dest, Object** src) { |
+ memcpy(dest, src, sizeof(*src)); |
+ } |
+ |
// Allocation sites are present in the snapshot, and must be linked into |
// a list at deserialization time. |
void RelinkAllocationSite(AllocationSite* site); |