summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-04 18:10:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-14 19:23:25 +0900
commit5ccb625fbbd1e774636a9fdbe0bf1c3d38e085d5 (patch)
tree23a8d2af84fed1b1f080953a5a1eab0b73c3ea8e /gc.c
parentee8bcbf40578c0c4e60063a3e0c86439a6891131 (diff)
Use `roomof` macro for rounding up divisions
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index a5e37b72e2..52d5609c3e 100644
--- a/gc.c
+++ b/gc.c
@@ -870,7 +870,7 @@ typedef struct rb_objspace {
#define BASE_SLOT_SIZE sizeof(RVALUE)
-#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
+#define CEILDIV(i, mod) roomof(i, mod)
enum {
HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
HEAP_PAGE_ALIGN_MASK = (~(~0UL << HEAP_PAGE_ALIGN_LOG)),