diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-12-03 14:42:53 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-12-26 20:45:12 +0900 |
commit | 989068cf7087bf48f30c7f7c3f9acfa0bfd263ef (patch) | |
tree | 8157b9b4a629b90f1d018b8ad12220e4d9a3be63 /internal.h | |
parent | 63c9f620cf87fb5fa08cdb7b0b4cc70e787f5cb2 (diff) |
internal/imemo.h rework
Arrange contents and eliminate macros, to make them readable.
Macro IFUNC_NEW was deleted because there was only one usage.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal.h b/internal.h index 337aee814d..fa6f78b52f 100644 --- a/internal.h +++ b/internal.h @@ -30,6 +30,8 @@ #include "internal/sanitizers.h" #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) +#define roomof(x, y) (((x) + (y) - 1) / (y)) +#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) /* Prevent compiler from reordering access */ #define ACCESS_ONCE(type,x) (*((volatile type *)&(x))) |