| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_BASE_MACROS_H_ | 5 #ifndef V8_BASE_MACROS_H_ |
| 6 #define V8_BASE_MACROS_H_ | 6 #define V8_BASE_MACROS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <cstring> | 11 #include <cstring> |
| 9 | 12 |
| 10 #include "include/v8stdint.h" | |
| 11 #include "src/base/build_config.h" | 13 #include "src/base/build_config.h" |
| 12 #include "src/base/compiler-specific.h" | 14 #include "src/base/compiler-specific.h" |
| 13 #include "src/base/logging.h" | 15 #include "src/base/logging.h" |
| 14 | 16 |
| 15 | 17 |
| 16 // The expression OFFSET_OF(type, field) computes the byte-offset | 18 // The expression OFFSET_OF(type, field) computes the byte-offset |
| 17 // of the specified field relative to the containing type. This | 19 // of the specified field relative to the containing type. This |
| 18 // corresponds to 'offsetof' (in stddef.h), except that it doesn't | 20 // corresponds to 'offsetof' (in stddef.h), except that it doesn't |
| 19 // use 0 or NULL, which causes a problem with the compiler warnings | 21 // use 0 or NULL, which causes a problem with the compiler warnings |
| 20 // we have enabled (which is also why 'offsetof' doesn't seem to work). | 22 // we have enabled (which is also why 'offsetof' doesn't seem to work). |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 392 } |
| 391 | 393 |
| 392 | 394 |
| 393 // Return the smallest multiple of m which is >= x. | 395 // Return the smallest multiple of m which is >= x. |
| 394 template <typename T> | 396 template <typename T> |
| 395 inline T RoundUp(T x, intptr_t m) { | 397 inline T RoundUp(T x, intptr_t m) { |
| 396 return RoundDown<T>(static_cast<T>(x + m - 1), m); | 398 return RoundDown<T>(static_cast<T>(x + m - 1), m); |
| 397 } | 399 } |
| 398 | 400 |
| 399 #endif // V8_BASE_MACROS_H_ | 401 #endif // V8_BASE_MACROS_H_ |
| OLD | NEW |