Chromium Code Reviews| Index: src/lazy-instance.h |
| diff --git a/src/lazy-instance.h b/src/lazy-instance.h |
| index 09dfe2154dc2992305a0b04787d8c3cca3391193..9748bb522996037e6069b5ed29a5a1f2b4530574 100644 |
| --- a/src/lazy-instance.h |
| +++ b/src/lazy-instance.h |
| @@ -104,9 +104,15 @@ struct LeakyInstanceTrait { |
| // Traits that define how an instance is allocated and accessed. |
| +#if V8_HOST_ARCH_MIPS |
|
danno
2012/03/16 12:40:08
I'd prefer avoiding the platform-specific define.
|
| +#define LAZY_ALIGN(x) __attribute__((aligned(__alignof__(x)))) |
| +#else // V8_HOST_ARCH_MIPS |
| +#define LAZY_ALIGN(x) |
| +#endif |
| + |
| template <typename T> |
| struct StaticallyAllocatedInstanceTrait { |
| - typedef char StorageType[sizeof(T)]; |
| + typedef char StorageType[sizeof(T)] LAZY_ALIGN(T); |
| static T* MutableInstance(StorageType* storage) { |
| return reinterpret_cast<T*>(storage); |