Chromium Code Reviews| Index: src/allocation.h |
| diff --git a/src/allocation.h b/src/allocation.h |
| index 45bde4c4cb07068a05e301d2124990637d82609d..09344f9187482b120bf6f5c44f1f717ad872513c 100644 |
| --- a/src/allocation.h |
| +++ b/src/allocation.h |
| @@ -30,6 +30,19 @@ |
| #include "globals.h" |
| +/* Round up n to be a multiple of sz, where sz is a power of 2. */ |
| +#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) |
| + |
| +// Specify memory alignment for structs, classes, etc. |
| +// Use like: |
| +// class ALIGN_AT(16) MyClass { ... } |
| +// ALIGNAS(16) int array[4]; |
|
Benedikt Meurer
2013/08/13 14:29:42
Typo: ALIGN_AT
yurys
2013/08/13 14:52:37
Done.
|
| +#if defined(_MSC_VER) |
| +#define ALIGN_AT(byte_alignment) __declspec(align(byte_alignment)) |
| +#elif defined(__GNUC__) |
| +#define ALIGN_AT(byte_alignment) __attribute__((aligned(byte_alignment))) |
| +#endif |
|
Benedikt Meurer
2013/08/13 14:29:42
Missing #else for other compilers.
yurys
2013/08/13 14:52:37
Done. Added #error for other compilers.
|
| + |
| namespace v8 { |
| namespace internal { |